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.
§Fallback chain
gsettings get org.gnome.desktop.interface color-scheme— works on all DEs that implement the freedesktop color-scheme setting (GNOME, KDE 5.x+, XFCE, etc.).- (with
kdefeature)~/.config/kdeglobalsbackground luminance. - Returns
false(light) if neither source is available.