Function broot::display::luma

source ·
pub fn luma() -> &'static Result<f32, TlError>
Expand description

Return the light of the terminal background, which is a value between 0 (black) and 1 (white).

Examples found in repository?
src/display/luma.rs (line 29)
28
29
30
31
32
33
34
    pub fn read() -> Self {
        match luma() {
            Ok(luma) if *luma > 0.6 => Self::Light,
            Ok(_) => Self::Dark,
            _ => Self::Unknown,
        }
    }