pub fn theme(timeout: Duration) -> Result<Theme, Error> {
    let rgb = rgb(timeout)?;

    // ITU-R BT.601
    let y = rgb.r as f64 * 0.299 + rgb.g as f64 * 0.587 + rgb.b as f64 * 0.114;

    if y > 32768.0 {
        Ok(Theme::Light)
    } else {
        Ok(Theme::Dark)
    }
}
/// get background color by `Theme`
get background color by `Theme`
get background color by ` Theme `
pub fn theme(timeout: Duration) -> Result<Theme, Error> {
    let rgb = rgb(timeout)?;
    // ITU-R BT.601
    let y = rgb.r as f64 * 0.299 + rgb.g as f64 * 0.587 + rgb.b as f64 * 0.114;
    if y > 32768.0 {
        Ok(Theme::Light)
    } else {
        Ok(Theme::Dark)
    }
}
pub fn theme ( timeout : Duration ) -> Result < Theme , Error > { let rgb = rgb ( timeout ) ? ; // ITU-R BT.601 let y = rgb . r as f64 * 0.299 + rgb . g as f64 * 0.587 + rgb . b as f64 * 0.114 ; if y > 32768.0 { Ok ( Theme :: Light ) } else { Ok ( Theme :: Dark ) } }
get background color by `Theme`
get background color by ` Theme `
timeout
Duration