dark_light/
mode.rs

1/// Enum representing dark mode, light mode, or unspecified.
2///
3/// If `Mode::Unspecified` is returned, it is expected that the user decides which theme mode to use for their specific use case.
4#[derive(Copy, Clone, PartialEq, Eq, Debug)]
5pub enum Mode {
6    /// Represents the dark mode option.
7    Dark,
8    /// Represents the light mode option.
9    Light,
10    /// Used when the system theme mode is unspecified.
11    Unspecified,
12}
13
14impl From<bool> for Mode {
15    fn from(dark: bool) -> Self {
16        if dark {
17            Self::Dark
18        } else {
19            Self::Light
20        }
21    }
22}