terminal-light 1.0.1

tells you whether your terminal is dark or light
Documentation
1
2
3
4
5
6
7
8
9
10
11
use {
    terminal_light::*,
};

/// print the "luma" value of the terminal's background color
/// (from 0 (black) to 1 (white)) or an error when it failed.
fn main() -> Result<(), TlError> {
    println!("{}", luma()?);
    Ok(())
}