[][src]Crate owo_colors

This crate provides OwoColorize, an extension trait for colorizing a formatter.

Example

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

Generically color

use owo_colors::OwoColorize;
use owo_colors::colors::*;
 
fn main() {
    // Generically color
    println!("My number might be {}!", 4.fg::<Black>().bg::<Yellow>());
}

Stylize

use owo_colors::OwoColorize;

println!("{}", "strikethrough".strikethrough());

Modules

colors

Color types for used for being generic over the color

styles

Different display styles (strikethrough, bold, etc.)

Structs

BgColorDisplay

Transparent wrapper around a type which implements all the formatters the wrapped type does, with the addition of changing the background color. Recommended to be constructed using OwoColorize.

FgColorDisplay

Transparent wrapper around a type which implements all the formatters the wrapped type does, with the addition of changing the foreground color. Recommended to be constructed using OwoColorize.

Traits

Color

A trait for describing a type which can be used with FgColorDisplay or BgCBgColorDisplay

OwoColorize

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