pub trait Coloration<ColorType>{
// Required method
fn as_colored_title(&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 as_colored_title(&self, color: ColorType) -> ColoredString
fn as_colored_title(&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".as_colored_title(Color::Green);
println!("{}", string);