terminal-light 1.0.1

tells you whether your terminal is dark or light
Documentation
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(())
}