Expand description
Coloring the terminal output.
§Basic Usage
use ino_color::cprintln;
use ino_color::fg;
use ino_color::bg;
use ino_color::style;
// Foreground color only
cprintln!(fg::Yellow, "Hello Fancy");
// Foreground + style
cprintln!((fg::Blue, style::Italic), "Savoy blue");
// Foreground + background + style
cprintln!((fg::Green, bg::Black, style::Bold),
"Green on black, bold");
// All format traits work as expected
cprintln!(fg::Green, "{:?}", vec![123]);
cprintln!(fg::Green, "{:X}", 123);Modules§
Macros§
- ceprint
- Print with color, wraps
std::eprint!. - ceprintln
- Print with color, wraps
std::eprintln!. - cprint
- Print with color, wraps
std::print!. - cprintln
- Print with color, wraps
std::println!.
Traits§
- AnsiSgr
- An attribute in the ANSI SGR list.
- BG
- The corresponding attribute is for background color.
- FG
- The corresponding attribute is for foreground color.
- HasColors
- Check whether ANSI color should be enabled.
- Style
- The corresponding attribute is for attributes which mainly affects the style of output, such as italic or bold.