public static class MacOSSemanticColorsAppKit's semantic colours, read as the CSS system colours they fill.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The read #838 was open against for three batches, on the claim that it could not be made. "An SDL process has no NSApplication and NSColor wants one" was written in three files and is false: a semantic colour is a class method resolved against NSAppearance.currentDrawingAppearance, which has a sensible value with no application object in sight, follows the system appearance, and works on a secondary thread. MacOSSemanticColorTests is the tripwire under that measurement and MacOSAccent was its first production caller; this is the rest of the palette through the same Component.
The mapping, AppKit name to CSS role. labelColor is CanvasText and windowBackgroundColor is Canvas; textColor on textBackgroundColor is the field pair; controlTextColor on controlColor is the button pair, with separatorColor for its border; selectedContentBackgroundColor with alternateSelectedControlTextColor is the selection pair — the same white MacOSAccent pairs with the accent, because on a Mac a selected row is drawn in the accent; disabledControlTextColor is GrayText and linkColor is LinkText. Each is nullable on its own, so a macOS old enough to lack one — selectedContentBackgroundColor is 10.14 — supplies the rest and leaves that role to the table.
⚠ labelColor is 84.7% opaque, and that is kept. AppKit draws its labels slightly soft over whatever is under them; a reader that rounded the alpha to one would put pure black text where the platform draws near-black, invisible in a screenshot and obvious beside a native window. The alpha reaches SystemPalette as read.
Returned in sRGB, because SystemSemanticColors is: the conversion to linear happens once, at the PlatformInput boundary that knows what a SystemPalette holds.
Methods (1)
public static SystemSemanticColors Read()Reads the palette.
Used by (2)
- DesktopAppearanceVixen.Platform.Desktop
- MacOSSemanticColorTestsVixen.Platform.MacOS.Tests