This crate answers the question "Is the terminal dark or light?".
It provides either
A use case in a TUI is to determine what set of colors would be more suitable depending on the terminal's background:
let should_use_light_skin = terminal_light::luma()
.map_or(false, |luma| luma > 0.6);