[][src]Trait owo_colors::OwoColorize

pub trait OwoColorize: Sized {
    fn fg<'a, C: Color>(&'a self) -> FgColorDisplay<'a, C, Self> { ... }
fn bg<'a, C: Color>(&'a self) -> BgColorDisplay<'a, C, Self> { ... }
fn bold<'a>(&'a self) -> BoldDisplay<'a, Self> { ... }
fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self> { ... }
fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self> { ... }
fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self> { ... }
fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self> { ... }
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self> { ... }
fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self> { ... }
fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self> { ... }
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self> { ... }
fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self> { ... }
fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self> { ... }
fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self> { ... }
fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self> { ... }
fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self> { ... }
fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self> { ... }
fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self> { ... }
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self> { ... }
fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self> { ... }
fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self> { ... }
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self> { ... }
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self> { ... }
fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self> { ... }
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self> { ... }
fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self> { ... }
fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self> { ... }
fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self> { ... }
fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self> { ... }
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self> { ... }
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self> { ... }
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self> { ... }
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self> { ... }
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self> { ... }
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self> { ... }
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self> { ... }
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self> { ... }
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self> { ... }
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self> { ... }
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self> { ... }
fn on_bright_magenta<'a>(
        &'a self
    ) -> BgColorDisplay<'a, BrightMagenta, Self> { ... }
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self> { ... }
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self> { ... }
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self> { ... }
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self> { ... }
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self> { ... }
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self> { ... } }

Extension trait for colorizing a type which implements a formatter (Display, Debug, etc.)

Example

use owo_colors::OwoColorize;
 
fn main() {
    println!("My number is {:#x}!", 10.green());
    println!("My number is not {}!", 4.on_red());
}

Provided methods

fn fg<'a, C: Color>(&'a self) -> FgColorDisplay<'a, C, Self>

Set the foreground color generically

fn bg<'a, C: Color>(&'a self) -> BgColorDisplay<'a, C, Self>

Set the background color generically

fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

Make the text bold

fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

Make the text dim

fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized

fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized

Make the text blink

Make the text blink (but fast!)

fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors

fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

Hide the text

fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text

fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color

fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the background color

fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color

fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the background color

fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color

fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the background color

fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color

fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the background color

fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color

fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the background color

fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color

fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color

fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color

fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color

fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color

fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the background color

fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color

fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

Change the background color

fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color

fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the background color

fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color

fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the background color

fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color

fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the background color

fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color

fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the background color

fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color

fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the background color

fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color

fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color

fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color

fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color

fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color

fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the background color

fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color

fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the background color

Loading content...

Implementors

impl<D: Sized> OwoColorize for D[src]

Loading content...