Expand description
§simple_colour
simple_colour is a collection of functions providing a more conveniet
process to change output styles/colouring in the terminal
It accepts both &str and String
Use the Colour trait to style your strings.
§Usage
Add the trait to your scope:
use simple_colour::Colour;
println!("{}", "Hello World Italic".italic()); //Style
println!("{}", "Hello World Red".red()); //Colour
println!("{}", "Hello World Bold Red".red().bold()); // Can combine colours and styles
println!("{}", "Hello World Bright Blue".bright_blue());
println!("{}", "Hello World".truecolour(192)); //Yellowish green (Truecolour 8-bit format)
println!("{}", "Hello World".truecolour_rgb(0, 170, 170)); //Cyan (Truecolour rgb format)
println!("{}", "Hello World".bg_truecolour(192)); //Yellowish green background (Truecolour 8-bit format)
println!("{}", "Hello World".bg_truecolour_rgb(0, 170, 170)); //Cyan background (Truecolour rgb format)
println!("{}", "Hello Red Background".bg_red()); //Red background
println!("{}", "Hello Rainbow".rainbow()); // Produces rainbow text
//Reset
let mut str = "Hello world".red().bold();
str = str.reset();
println!("{}",str);
// Or
let str = "Hello world".red().bold();
let str = str.reset();
println!("{}",str);See the Colour trait for all the methods. All methods return a String.