fg/
fg.rs

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