Beispiel #1
0
        public static void ApplyThemeColours(Generic2DRenderer surface)
        {
            var foregroundThemeColor      = ((Xamarin.Forms.Color)App.Current.Resources["PrimaryTextColor"]).ToSKColor();
            var mutedForegroundThemeColor = ((Xamarin.Forms.Color)App.Current.Resources["MutedForegroundColor"]).ToSKColor();

            surface.ColorPalette[ThemeColorPreset.ForegroundText]  = new ColorValue(foregroundThemeColor.Red, foregroundThemeColor.Green, foregroundThemeColor.Blue);
            surface.ColorPalette[ThemeColorPreset.Foreground]      = new ColorValue(foregroundThemeColor.Red, foregroundThemeColor.Green, foregroundThemeColor.Blue);
            surface.ColorPalette[ThemeColorPreset.MutedForeground] = new ColorValue(mutedForegroundThemeColor.Red, mutedForegroundThemeColor.Green, mutedForegroundThemeColor.Blue);
            surface.ColorPalette[ThemeColorPreset.TextShadow]      = new ColorValue(mutedForegroundThemeColor.Red, mutedForegroundThemeColor.Green, mutedForegroundThemeColor.Blue);
        }
Beispiel #2
0
        public static void ApplyThemeColours(Generic2DRenderer surface)
        {
            var foregroundThemeColor      = new SKColor(64, 64, 64);
            var mutedForegroundThemeColor = new SKColor(128, 128, 128);

            surface.ColorPalette[ThemeColorPreset.Background]      = new ColorValue(0, 0, 0);
            surface.ColorPalette[ThemeColorPreset.Subtle]          = new ColorValue(64, 64, 64);
            surface.ColorPalette[ThemeColorPreset.ForegroundText]  = new ColorValue(foregroundThemeColor.Red, foregroundThemeColor.Green, foregroundThemeColor.Blue);
            surface.ColorPalette[ThemeColorPreset.Foreground]      = new ColorValue(foregroundThemeColor.Red, foregroundThemeColor.Green, foregroundThemeColor.Blue);
            surface.ColorPalette[ThemeColorPreset.MutedForeground] = new ColorValue(mutedForegroundThemeColor.Red, mutedForegroundThemeColor.Green, mutedForegroundThemeColor.Blue);
            surface.ColorPalette[ThemeColorPreset.TextShadow]      = new ColorValue(mutedForegroundThemeColor.Red, mutedForegroundThemeColor.Green, mutedForegroundThemeColor.Blue);
        }