termprofile 0.2.3

A library to detect and handle terminal color/styling support
Documentation
1
2
3
4
5
6
7
8
9
10
use std::io::stdout;

use termprofile::{DetectorSettings, TermProfile, TermVars};

fn main() {
    let mut vars = TermVars::from_env(&stdout(), DetectorSettings::with_query().unwrap());
    vars.overrides.force_color = "1".into();
    let profile = TermProfile::detect_with_vars(vars);
    println!("Profile with override: {profile:?}");
}