bg/bg.rs
1//! This example shows how to retrieve the terminal's background color.
2
3use terminal_colorsaurus::{background_color, Error, QueryOptions};
4
5fn main() -> Result<(), display::DisplayAsDebug<Error>> {
6 let bg = background_color(QueryOptions::default())?;
7 let bg_8bit = bg.scale_to_8bit();
8 println!("rgb16({}, {}, {})", bg.r, bg.g, bg.b);
9 println!("rgb8({}, {}, {})", bg_8bit.0, bg_8bit.1, bg_8bit.2);
10 Ok(())
11}
12
13#[path = "../examples-utils/display.rs"]
14mod display;