pub trait Stylize: Sized {
    type Styled: AsRef<ContentStyle> + AsMut<ContentStyle>;

Show 64 methods fn stylize(self) -> Self::Styled; fn with(self, color: Color) -> Self::Styled { ... } fn on(self, color: Color) -> Self::Styled { ... } fn underline(self, color: Color) -> Self::Styled { ... } fn attribute(self, attr: Attribute) -> Self::Styled { ... } fn reset(self) -> Self::Styled { ... } fn bold(self) -> Self::Styled { ... } fn underlined(self) -> Self::Styled { ... } fn reverse(self) -> Self::Styled { ... } fn dim(self) -> Self::Styled { ... } fn italic(self) -> Self::Styled { ... } fn negative(self) -> Self::Styled { ... } fn slow_blink(self) -> Self::Styled { ... } fn rapid_blink(self) -> Self::Styled { ... } fn hidden(self) -> Self::Styled { ... } fn crossed_out(self) -> Self::Styled { ... } fn black(self) -> Self::Styled { ... } fn on_black(self) -> Self::Styled { ... } fn underline_black(self) -> Self::Styled { ... } fn dark_grey(self) -> Self::Styled { ... } fn on_dark_grey(self) -> Self::Styled { ... } fn underline_dark_grey(self) -> Self::Styled { ... } fn red(self) -> Self::Styled { ... } fn on_red(self) -> Self::Styled { ... } fn underline_red(self) -> Self::Styled { ... } fn dark_red(self) -> Self::Styled { ... } fn on_dark_red(self) -> Self::Styled { ... } fn underline_dark_red(self) -> Self::Styled { ... } fn green(self) -> Self::Styled { ... } fn on_green(self) -> Self::Styled { ... } fn underline_green(self) -> Self::Styled { ... } fn dark_green(self) -> Self::Styled { ... } fn on_dark_green(self) -> Self::Styled { ... } fn underline_dark_green(self) -> Self::Styled { ... } fn yellow(self) -> Self::Styled { ... } fn on_yellow(self) -> Self::Styled { ... } fn underline_yellow(self) -> Self::Styled { ... } fn dark_yellow(self) -> Self::Styled { ... } fn on_dark_yellow(self) -> Self::Styled { ... } fn underline_dark_yellow(self) -> Self::Styled { ... } fn blue(self) -> Self::Styled { ... } fn on_blue(self) -> Self::Styled { ... } fn underline_blue(self) -> Self::Styled { ... } fn dark_blue(self) -> Self::Styled { ... } fn on_dark_blue(self) -> Self::Styled { ... } fn underline_dark_blue(self) -> Self::Styled { ... } fn magenta(self) -> Self::Styled { ... } fn on_magenta(self) -> Self::Styled { ... } fn underline_magenta(self) -> Self::Styled { ... } fn dark_magenta(self) -> Self::Styled { ... } fn on_dark_magenta(self) -> Self::Styled { ... } fn underline_dark_magenta(self) -> Self::Styled { ... } fn cyan(self) -> Self::Styled { ... } fn on_cyan(self) -> Self::Styled { ... } fn underline_cyan(self) -> Self::Styled { ... } fn dark_cyan(self) -> Self::Styled { ... } fn on_dark_cyan(self) -> Self::Styled { ... } fn underline_dark_cyan(self) -> Self::Styled { ... } fn white(self) -> Self::Styled { ... } fn on_white(self) -> Self::Styled { ... } fn underline_white(self) -> Self::Styled { ... } fn grey(self) -> Self::Styled { ... } fn on_grey(self) -> Self::Styled { ... } fn underline_grey(self) -> Self::Styled { ... }
}
Expand description

Provides a set of methods to set attributes and colors.

Examples

use crossterm::style::Stylize;

println!("{}", "Bold text".bold());
println!("{}", "Underlined text".underlined());
println!("{}", "Negative text".negative());
println!("{}", "Red on blue".red().on_blue());

Required Associated Types

This type with styles applied.

Required Methods

Styles this type.

Provided Methods

Sets the foreground color.

Sets the background color.

Sets the underline color.

Styles the content with the attribute.

Applies the Reset attribute to the text.

Applies the Bold attribute to the text.

Applies the Underlined attribute to the text.

Applies the Reverse attribute to the text.

Applies the Dim attribute to the text.

Applies the Italic attribute to the text.

Applies the Reverse attribute to the text.

Applies the SlowBlink attribute to the text.

Applies the RapidBlink attribute to the text.

Applies the Hidden attribute to the text.

Applies the CrossedOut attribute to the text.

Sets the foreground color to Black.

Sets the background color to Black.

Sets the underline color to Black.

Sets the foreground color to DarkGrey.

Sets the background color to DarkGrey.

Sets the underline color to DarkGrey.

Sets the foreground color to Red.

Sets the background color to Red.

Sets the underline color to Red.

Sets the foreground color to DarkRed.

Sets the background color to DarkRed.

Sets the underline color to DarkRed.

Sets the foreground color to Green.

Sets the background color to Green.

Sets the underline color to Green.

Sets the foreground color to DarkGreen.

Sets the background color to DarkGreen.

Sets the underline color to DarkGreen.

Sets the foreground color to Yellow.

Sets the background color to Yellow.

Sets the underline color to Yellow.

Sets the foreground color to DarkYellow.

Sets the background color to DarkYellow.

Sets the underline color to DarkYellow.

Sets the foreground color to Blue.

Sets the background color to Blue.

Sets the underline color to Blue.

Sets the foreground color to DarkBlue.

Sets the background color to DarkBlue.

Sets the underline color to DarkBlue.

Sets the foreground color to Magenta.

Sets the background color to Magenta.

Sets the underline color to Magenta.

Sets the foreground color to DarkMagenta.

Sets the background color to DarkMagenta.

Sets the underline color to DarkMagenta.

Sets the foreground color to Cyan.

Sets the background color to Cyan.

Sets the underline color to Cyan.

Sets the foreground color to DarkCyan.

Sets the background color to DarkCyan.

Sets the underline color to DarkCyan.

Sets the foreground color to White.

Sets the background color to White.

Sets the underline color to White.

Sets the foreground color to Grey.

Sets the background color to Grey.

Sets the underline color to Grey.

Implementations on Foreign Types

Implementors