Crate dark_light

Source
Expand description

This crate is designed to facilitate the development of applications that support both light and dark themes. It provides a simple API to detect the current theme mode.

It supports macOS, Windows, Linux, BSDs, and WASM.

On Linux the XDG Desktop Portal D-Bus API is checked for the color-scheme preference, which works in Flatpak sandboxes without needing filesystem access.

Enums§

Error
An error that can occur when detecting the system theme mode.
Mode
Enum representing dark mode, light mode, or unspecified.

Functions§

detect
Detects the system theme mode.