Vixen
dd8b0a81
csharp
public enum SystemColorScheme

What appearance the operating system is set to.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The platform half of @media (prefers-color-scheme: …). It is deliberately three values rather than two: Unknown is the honest answer on a platform that has no such setting, on one whose setting could not be read, and on a headless run — and it is a different answer from Light, which is what a system actually set to light says.

⚠ Collapsing Unknown into Light is the mistake this enum exists to prevent. A stylesheet asks two questions — (prefers-color-scheme: dark) and (prefers-color-scheme: light) — and CSS says both are false when there is no preference. A platform that reported light where it meant "I do not know" would make the second one true, which is a stylesheet taking a branch nobody asked for rather than falling through to its own default.

Fields and properties (3)

  • Unknown

    The platform has no appearance setting, or it could not be read.

  • Light

    The system is set to a light appearance.

  • Dark

    The system is set to a dark appearance.

Used by (13)

  • ColorSchemeWiringTestsVixen.Ui.Desktop.Tests
  • DesktopAppearanceVixen.Platform.Desktop
  • DesktopAppearanceTestsVixen.Platform.Desktop.Tests
  • DesktopPlatformVixen.Platform.Desktop
  • HeadlessPlatformVixen.Platform.Headless
  • IPlatformVixen.Platform
  • LinuxAppearanceVixen.Platform.Linux
  • MacOSAppearanceVixen.Platform.MacOS
  • PlatformInputVixen.Platform.Ui
  • SystemPaletteWiringTestsVixen.Platform.Ui.Tests
  • WindowsAppearanceVixen.Platform.Windows
  • PinningPlatformVixen.App.Tests
  • PresentingPlatformVixen.App.Tests