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¶
The page and text field background.
window_text¶
control_background¶
Button and control faces.
control_text¶
control_border¶
Control borders and frames.
accent¶
Selected items and selected text.
accent_text¶
disabled_text¶
Disabled text.
hyperlink¶
Hyperlinks.
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¶
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.