public static class MacOSAppearanceWhat appearance macOS is set to, read out of the user's defaults.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
AppleInterfaceStyle in NSUserDefaults, and not NSApp.effectiveAppearance. The two agree on a normal AppKit application, and only one of them answers in a process that never made an NSApplication — which is every SDL application, this engine's included. effectiveAppearance on a nil NSApp is a message to nil, and a message to nil returns zero, which reads as light.
⚠ The key is absent under a light appearance rather than set to "Light". Dark mode writes "Dark"; turning it off removes the key. So the two answers this can give are "the string says dark" and "there is no string", and the second one is genuinely light rather than unknown — NSUserDefaults itself is available on every macOS, so reaching it and finding nothing is an answer.
Foundation, not AppKit, so it does not need the main thread — see IsMainThread for what does.
Methods (1)
public static SystemColorScheme Read()Reads the current appearance.
Used by (1)
- DesktopAppearanceVixen.Platform.Desktop