Skip to content

ui::HighContrastPalette

Header: winui/ui/themes/ThemeSource.hpp.

The colors of the system's contrast theme, used as they are. The defaults are black on white, so a default-constructed OsThemeSnapshot is usable without setting every field.

These are the eight colors a user picks in a contrast theme, plus a border color.

Example:

ui::OsThemeSnapshot os;
os.high_contrast = true;
os.hc            = ui::HighContrastPalette::windows10_high_contrast_black();

// A contrast theme is on: the window draws with the palette the user picked.
window.pin_theme(ui::resolve_theme(ui::ThemeRequest{}, os));

window_background

Color window_background = colors::White

The page and text field background.

window_text

Color window_text = colors::Black

Text on window_background.

control_background

Color control_background = colors::White

Button and control faces.

control_text

Color control_text = colors::Black

Text on control_background.

control_border

Color control_border = colors::Black

Control borders and frames.

accent

Color accent = Color::from_argb(0xFF0078D4)

Selected items and selected text.

accent_text

Color accent_text = colors::White

Text on accent.

disabled_text

Color disabled_text = Color::from_argb(0xFF6D6D6D)

Disabled text.

Color hyperlink = Color::from_argb(0xFF0066CC)

Hyperlinks.

aquatic

static HighContrastPalette aquatic()

Aquatic, the contrast theme Windows 11 turns on when Left Alt+Left Shift+Print Screen is pressed and no contrast theme was chosen before. The border color is not one a user picks, so it takes control_text, the color contrast themes draw control borders in.

Fluent 2 uses these colors when an app forces ThemeMode::HighContrast while the system has no contrast theme on.

windows10_high_contrast_black

static HighContrastPalette windows10_high_contrast_black()

High Contrast Black as Windows 8 through 10 ship it, designed for a 14:1 contrast ratio. The border takes control_text, as in aquatic(). Metro, MDL2 and Fluent use it when high contrast is forced.