Skip to content

code-translation/colorstyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crates.io Released API docs GPL3 licensed Downloads of Crates.io Lines of code Build Languages

colorStyle is a library of styles for command-line text.

Inspired by flylog/colorstyle (golang)

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("ๅๆ˜พๆ–‡ๆœฌ");

Doc

See this document at API documentation

Todo

  • ๅขžๅŠ sprintf()ๅฎๆ”ฏๆŒๅฏๅ˜ๆ•ฐ้‡็š„ๅ‚ๆ•ฐ๏ผŒๅ‚่€ƒๆ ‡ๅ‡†็š„println!()

Screen

About

colorStyle is a library of styles for command-line text write in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages