Trait coloriz::ColorApply[][src]

pub trait ColorApply: Into<ColorStyle> {
    fn to<C: ?Sized>(self, c: C) -> StyledText
    where
        C: Colorize
, { ... }
fn under<C: ?Sized>(self, c: C) -> StyledText
    where
        C: Colorize
, { ... } }
Expand description

A Color that can apply to text

Provided methods

fn to<C: ?Sized>(self, c: C) -> StyledText where
    C: Colorize
[src]

Applies self to the foreground color of c

Example

let red = Color::Red.to("lorem ipsum");
assert_eq!(red, "lorem ipsum".fg(Color::Red));

fn under<C: ?Sized>(self, c: C) -> StyledText where
    C: Colorize
[src]

Applies self to the background color of c

Example

let green = Color::Green.under("lorem ipsum");
assert_eq!(green, "lorem ipsum".bg(Color::Green));

Implementors