Trait cprint::coloration::Coloration
source · pub trait Coloration<ColorType>{
// Required method
fn apply_color(&self, color: ColorType) -> ColoredString;
}
Expand description
Trait for coloration of text. Coloration<ColorType>
is the type of the color you want to use. It can be a Color
or a String
.
Required Methods§
sourcefn apply_color(&self, color: ColorType) -> ColoredString
fn apply_color(&self, color: ColorType) -> ColoredString
Apply a color and boldness to a string.
§Examples
use cprint::{Color, Coloration};
let string = "An amazing string in green and bold".apply_color(Color::Green);
println!("{}", string);