Crate colorstyle[][src]

Expand description

ColorStyle is a library of styles for command-line text. Used to modify the style of text for standard output to the terminal interface, you can change the foreground colour of the text, the background colour, add underline and bold, etc.

ColorStyle 是一个用于命令行文本的样式库。 用于标准输出到终端界面的文本的样式修改,可以修改文本前景色,背景色,增加下划线和加粗显等。

Example

let text = colorstyle::green("green");
println!("a {} text", text);
let text = colorstyle::blue("Blue");
println!("a {} text\n", text);
let text = colorstyle::CSS::new().color_red().sprint("red");
println!("a {} text",text);
colorstyle::CSS::new().style_italic().color_red().bg_yellow().println("a italic red bgYellow text: {} Hello 世界!");
colorstyle::CSS::new().style_bold().println("a bold text: {}Hello 世界!");
colorstyle::CSS::new().style_italic().println("a italic text: {}Hello 世界!");
colorstyle::CSS::new().color_magenta().println("a magenta text: {}Hello 世界!");
colorstyle::CSS::new().bg_cyan().println("a background color cyan text: {}Hello 世界!");
colorstyle::CSS::new().bg_cyan().println("a background color cyan text");
let mut css = colorstyle::CSS::new();
css.style_strikethrough().println("删除线文本");
css.style_underline().println("下划线文本");
css.style_reverse().println("反显文本");

Structs

Enums

Functions

生成黑色的文本

生成蓝色的文本

生成亮蓝的文本

生成亮青色的文本

生成亮品红的文本

生成亮红色的文本

生成亮白色的文本

生成亮黄色的文本

生成青色的文本

生成灰色的文本

生成绿色的文本

生成品红色的文本

生成红色的文本

生成白色的文本

生成黄色的文本