Trait cprint::coloration::Coloration

source ·
pub trait Coloration<ColorType>
where ColorType: Into<Color>,
{ // 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§

source

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);

Implementors§

source§

impl<FS, ColorType> Coloration<ColorType> for FS
where FS: AsRef<str> + ?Sized, ColorType: Into<Color>,