public static class WindowsSemanticColorsThe palette Windows is drawing with, read only while a high-contrast scheme is on.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The classic system colours — COLOR_WINDOW, COLOR_WINDOWTEXT, COLOR_BTNFACE and the rest — are the one place Windows publishes a whole semantic palette, and ⚠ they are only the palette the user is looking at while a high-contrast scheme is on. Dark mode does not touch them: on a Windows 10 or 11 set to dark with no high-contrast scheme, GetSysColor(COLOR_WINDOW) still answers white and COLOR_WINDOWTEXT black, because the classic table predates the Personalize key and nothing rewrites it when the app theme flips. A reader that supplied those unconditionally would therefore put a white Canvas under a dark document — actively worse than the browser-default dark table SystemPalette already carries, and quieter, since a light field on a dark window reads as a choice rather than a bug.
Under a high-contrast scheme the table is exactly right, and it is the read that matters most. A high-contrast scheme is a palette the user picked — Aquatic, Desert, Dusk, Night sky, or their own edit of one — and SystemPalette.HighContrast is a fixed guess at it that cannot know which. This is the same gate Chromium's forced-colours path uses: system colours from GetSysColor while HCF_HIGHCONTRASTON is set, its own tables otherwise. And it composes with what PlatformInput already does: ApplyAccessibility switches the document to the forced table on the same flag, Repalette resets to it, and a role supplied here survives that reset.
⚠ The dark-mode half is not unwritten but blocked at this layer, and the block is worth naming so nobody widens the gate to close it. What follows the app theme is WinRT's UISettings.GetColorValue(UIColorType.Foreground) and its Background, which are a COM activation away and not a user32 call; nothing in this assembly activates a WinRT class today. Until that exists, a Windows in dark mode answers Unknown and the document follows the appearance through SystemPalette.Dark, which is what a browser does there too.
The mapping. Canvas/CanvasText and Field/FieldText are both COLOR_WINDOW/COLOR_WINDOWTEXT, because Windows has one "window" colour and draws edit controls in it; ButtonBorder is COLOR_BTNTEXT, which is what a high-contrast scheme draws a button's edge in and what Chromium maps it to; LinkText is COLOR_HOTLIGHT; the selection pair is the pair WindowsAccent reads, because under high contrast the selection is the accent. Returned in sRGB, because SystemSemanticColors is.
Methods (1)
public static SystemSemanticColors Read()Reads the palette.
Used by (2)
- DesktopAppearanceVixen.Platform.Desktop
- WindowsSemanticColorsTestsVixen.Platform.Windows.Tests