detect_system_dark_mode

Function detect_system_dark_mode 

Source
pub fn detect_system_dark_mode() -> bool
Expand description

Detect whether the operating system is configured for dark mode.

Heuristics per platform:

  • macOS: defaults read -g AppleInterfaceStyle → “Dark” means dark mode.
  • Linux: checks $GTK_THEME for a -dark suffix, then falls back to gsettings get org.gnome.desktop.interface color-scheme.
  • Windows: reads AppsUseLightTheme from the registry via reg query.

Returns true (dark) when detection fails or the platform is unrecognized.