[−][src]Trait owo_colors::OwoColorize
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
fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
Make the text blink
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
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