Expand description
§termcol
Dependency-less library for simple terminal text coloring and formating
§Usage
Basic usage (checkout the examples/usage.rs file for more information)
use termcol::*;
fn main() {
println!("{}red{}", color("red"), color("reset"));
println!("{}bold{}", format("bold"), format("reset"));
println!("{}", color_string("im blue", "blue"));
}
§LICENSE
This project is distributed under MIT license.
Functions§
- clean_
output - Function providing a way to disable any form of coloring/formating
- color
- Function providing a way to color your cli output
- color_
string - Function providing a way to color your cli output
- format
- Function providing a way to format you cli output
- format_
string - Function providing a way to format you cli output
- get_
disable_ coloring_ state - Helper function returning the value of DISALBE_COLORING global variable
- optimize
- Function which optimizes given string from unneded reset control codes
- true_
color - Returns true color escape codes for given u8 values background_or_foreground true => change background background_or_foreground false => change foreground
- true_
color_ hex - Returns true color escape codes from given hex string background_or_foreground true => change background background_or_foreground false => change foreground
- true_
color_ string - Returns given string altered with true color escape codes from given u8 values
- true_
color_ string_ hex - Returns given string altered with true color escape codes from given hex strings