Skip to main content

no_color

Function no_color 

Source
pub fn no_color() -> bool
Expand description

Detect if NO_COLOR environment variable is set.

When set, all colorization should be disabled regardless of theme settings. This follows the standard: https://no-color.org/

ยงExample

use netspeed_cli::terminal::no_color;

if no_color() {
    println!("Plain output");
} else {
    println!("Colorized output");
}