public new void ApplyColorScheme(HighContrastOption hco) { ColorScheme cs = ColorScheme.GetHighContrastScheme(hco); if (cs != ColorScheme) { ColorScheme = cs; return; } UpdateAppearance(); }
/// <summary> /// Create a color scheme with high-contrast colors, based upon one of the available options. /// </summary> /// <param name="hco">The high-contrast scheme option to create.</param> /// <returns></returns> public static ColorScheme GetHighContrastScheme(HighContrastOption hco) { ColorScheme cs = new ColorScheme(); cs.IsHighContrast = true; switch (hco) { case HighContrastOption.WhiteOnBlack: cs.MainColor = Black; //HighContrastPurple; cs.SecondaryColor = Gray; // items that use main or secondary color should use other options cs.BackgroundColor = Black; cs.LightBackgroundColor = Black; cs.SelectionColor = HighContrastLightBlue; cs.HighlightColor = HighContrastLightBlue; cs.SecondHighlightColor = HighContrastLightBlue; cs.ThirdHighlightColor = HighContrastLightBlue; cs.ForegroundColor = White; cs.BorderColor = White; cs.LightDisabledColor = HighContrastLightGreen; cs.DarkDisabledColor = HighContrastLightGreen; cs.WindowTitleBarColor = HighContrastPurple; cs.WindowTitleBarTextColor = White; cs.WindowInactiveColor = HighContrastPurple; break; case HighContrastOption.GreenOnBlack: cs.MainColor = Black; //HighContrastLightBlue; cs.SecondaryColor = Gray; // items that use main or secondary color should use other options cs.BackgroundColor = Black; cs.LightBackgroundColor = Black; cs.SelectionColor = HighContrastBlue; cs.HighlightColor = HighContrastBlue; cs.SecondHighlightColor = HighContrastBlue; cs.ThirdHighlightColor = HighContrastBlue; cs.ForegroundColor = HighContrastGreen; cs.BorderColor = White; cs.LightDisabledColor = HighContrastGray; cs.DarkDisabledColor = HighContrastGray; cs.WindowTitleBarColor = HighContrastLightBlue; cs.WindowTitleBarTextColor = Black; cs.WindowInactiveColor = HighContrastPurple; break; case HighContrastOption.BlackOnWhite: cs.MainColor = White; //HighContrastLightBlue; cs.SecondaryColor = Gray; // items that use main or secondary color should use other options cs.BackgroundColor = White; cs.LightBackgroundColor = White; cs.SelectionColor = HighContrastLightPurple; cs.HighlightColor = HighContrastLightPurple; cs.SecondHighlightColor = HighContrastLightPurple; cs.ThirdHighlightColor = HighContrastLightPurple; cs.ForegroundColor = Black; cs.BorderColor = Black; cs.LightDisabledColor = HighContrastRed; cs.DarkDisabledColor = HighContrastRed; cs.WindowTitleBarColor = HighContrastLightBlue; cs.WindowTitleBarTextColor = Black; cs.WindowInactiveColor = HighContrastLightBlue; break; default: break; } cs.CreateAccentPalette(cs); return(cs); }