Skip to main content

Crate ino_color

Crate ino_color 

Source
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§

bg
Named 16 background colors.
fg
Named 16 foreground colors.
style
Commonly used style attributes.

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.