Crate dark_light

source ·
Expand description

Detect if dark mode or light mode is enabled.

§Examples

let mode = dark_light::detect();

match mode {
    // Dark mode
    dark_light::Mode::Dark => {},
    // Light mode
    dark_light::Mode::Light => {},
    // Unspecified
    dark_light::Mode::Default => {},
}

Enums§

Functions§

  • Detect if light mode or dark mode is enabled. If the mode can’t be detected, fall back to Mode::Default.