Registry / utility / dark-light

dark-light

JSON →
library2.0.0rscratesunverified

Detects if the system is using dark mode or light mode.

# Cargo.toml [dependencies] dark-light = "2.0.0"
INSTALL
IMPORT
SIG · DARK-LIGHT
D
dark-light
utilityrustv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Mode
use dark_light::Mode;

Detects the current system theme (dark or light mode).

use dark_light::Mode; fn main() { match dark_light::detect() { Mode::Dark => println!("Dark mode"), Mode::Light => println!("Light mode"), _ => println!("Unknown"), } }
Debug
Known issues
gotchaDetection may not work on all platforms or desktop environments.
fix
Check platform support; fallback to default if detection fails.
affects: >=0.0.0
Upgrade
Version history
2.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
dark-light — cargo add dark-light · libregistry