[][src]Trait crossterm::style::Colorize

pub trait Colorize<D: Display + Clone> {
    fn black(self) -> StyledContent<D>;
fn dark_grey(self) -> StyledContent<D>;
fn red(self) -> StyledContent<D>;
fn dark_red(self) -> StyledContent<D>;
fn green(self) -> StyledContent<D>;
fn dark_green(self) -> StyledContent<D>;
fn yellow(self) -> StyledContent<D>;
fn dark_yellow(self) -> StyledContent<D>;
fn blue(self) -> StyledContent<D>;
fn dark_blue(self) -> StyledContent<D>;
fn magenta(self) -> StyledContent<D>;
fn dark_magenta(self) -> StyledContent<D>;
fn cyan(self) -> StyledContent<D>;
fn dark_cyan(self) -> StyledContent<D>;
fn white(self) -> StyledContent<D>;
fn grey(self) -> StyledContent<D>;
fn on_black(self) -> StyledContent<D>;
fn on_dark_grey(self) -> StyledContent<D>;
fn on_red(self) -> StyledContent<D>;
fn on_dark_red(self) -> StyledContent<D>;
fn on_green(self) -> StyledContent<D>;
fn on_dark_green(self) -> StyledContent<D>;
fn on_yellow(self) -> StyledContent<D>;
fn on_dark_yellow(self) -> StyledContent<D>;
fn on_blue(self) -> StyledContent<D>;
fn on_dark_blue(self) -> StyledContent<D>;
fn on_magenta(self) -> StyledContent<D>;
fn on_dark_magenta(self) -> StyledContent<D>;
fn on_cyan(self) -> StyledContent<D>;
fn on_dark_cyan(self) -> StyledContent<D>;
fn on_white(self) -> StyledContent<D>;
fn on_grey(self) -> StyledContent<D>; }

Provides a set of methods to set the colors.

Every method with the on_ prefix sets the background color. All other methods set the foreground color.

Method names correspond to the Color enum variants.

Examples

use crossterm::style::Colorize;

let styled_text = "Red foreground color on blue background.".red().on_blue();
println!("{}", styled_text);

Required methods

fn black(self) -> StyledContent<D>

fn dark_grey(self) -> StyledContent<D>

fn red(self) -> StyledContent<D>

fn dark_red(self) -> StyledContent<D>

fn green(self) -> StyledContent<D>

fn dark_green(self) -> StyledContent<D>

fn yellow(self) -> StyledContent<D>

fn dark_yellow(self) -> StyledContent<D>

fn blue(self) -> StyledContent<D>

fn dark_blue(self) -> StyledContent<D>

fn magenta(self) -> StyledContent<D>

fn dark_magenta(self) -> StyledContent<D>

fn cyan(self) -> StyledContent<D>

fn dark_cyan(self) -> StyledContent<D>

fn white(self) -> StyledContent<D>

fn grey(self) -> StyledContent<D>

fn on_black(self) -> StyledContent<D>

fn on_dark_grey(self) -> StyledContent<D>

fn on_red(self) -> StyledContent<D>

fn on_dark_red(self) -> StyledContent<D>

fn on_green(self) -> StyledContent<D>

fn on_dark_green(self) -> StyledContent<D>

fn on_yellow(self) -> StyledContent<D>

fn on_dark_yellow(self) -> StyledContent<D>

fn on_blue(self) -> StyledContent<D>

fn on_dark_blue(self) -> StyledContent<D>

fn on_magenta(self) -> StyledContent<D>

fn on_dark_magenta(self) -> StyledContent<D>

fn on_cyan(self) -> StyledContent<D>

fn on_dark_cyan(self) -> StyledContent<D>

fn on_white(self) -> StyledContent<D>

fn on_grey(self) -> StyledContent<D>

Loading content...

Implementations on Foreign Types

impl Colorize<&'static str> for &'static str[src]

Loading content...

Implementors

Loading content...