pub fn system_is_dark() -> boolExpand description
Detect whether the system is using a dark color scheme.
Uses synchronous, platform-specific checks so the result is available
immediately at window creation time (before any async portal response).
The result is cached after the first call using OnceLock.
ยงPlatform Behavior
- Linux: Queries
gsettingsforcolor-scheme; falls back to KDEkdeglobalsbackground luminance (withkdefeature). - macOS: Reads
AppleInterfaceStylefrom global user defaults; returnstruewhen the value is"Dark"(key absent in light mode). - Windows: Checks foreground color luminance from
UISettingsvia BT.601 coefficients (requireswindowsfeature). - Other platforms / missing features: Returns
false(light).