pub trait Colorize {
Show 49 methods
// Required methods
fn color<S: Into<Color>>(self, color: S) -> ColoredString;
fn on_color<S: Into<Color>>(self, color: S) -> ColoredString;
fn clear(self) -> ColoredString;
fn normal(self) -> ColoredString;
fn bold(self) -> ColoredString;
fn dimmed(self) -> ColoredString;
fn italic(self) -> ColoredString;
fn underline(self) -> ColoredString;
fn blink(self) -> ColoredString;
fn reverse(self) -> ColoredString;
fn reversed(self) -> ColoredString;
fn hidden(self) -> ColoredString;
fn strikethrough(self) -> ColoredString;
// Provided methods
fn black(self) -> ColoredString
where Self: Sized { ... }
fn red(self) -> ColoredString
where Self: Sized { ... }
fn green(self) -> ColoredString
where Self: Sized { ... }
fn yellow(self) -> ColoredString
where Self: Sized { ... }
fn blue(self) -> ColoredString
where Self: Sized { ... }
fn magenta(self) -> ColoredString
where Self: Sized { ... }
fn purple(self) -> ColoredString
where Self: Sized { ... }
fn cyan(self) -> ColoredString
where Self: Sized { ... }
fn white(self) -> ColoredString
where Self: Sized { ... }
fn bright_black(self) -> ColoredString
where Self: Sized { ... }
fn bright_red(self) -> ColoredString
where Self: Sized { ... }
fn bright_green(self) -> ColoredString
where Self: Sized { ... }
fn bright_yellow(self) -> ColoredString
where Self: Sized { ... }
fn bright_blue(self) -> ColoredString
where Self: Sized { ... }
fn bright_magenta(self) -> ColoredString
where Self: Sized { ... }
fn bright_purple(self) -> ColoredString
where Self: Sized { ... }
fn bright_cyan(self) -> ColoredString
where Self: Sized { ... }
fn bright_white(self) -> ColoredString
where Self: Sized { ... }
fn on_black(self) -> ColoredString
where Self: Sized { ... }
fn on_red(self) -> ColoredString
where Self: Sized { ... }
fn on_green(self) -> ColoredString
where Self: Sized { ... }
fn on_yellow(self) -> ColoredString
where Self: Sized { ... }
fn on_blue(self) -> ColoredString
where Self: Sized { ... }
fn on_magenta(self) -> ColoredString
where Self: Sized { ... }
fn on_purple(self) -> ColoredString
where Self: Sized { ... }
fn on_cyan(self) -> ColoredString
where Self: Sized { ... }
fn on_white(self) -> ColoredString
where Self: Sized { ... }
fn on_bright_black(self) -> ColoredString
where Self: Sized { ... }
fn on_bright_red(self) -> ColoredString
where Self: Sized { ... }
fn on_bright_green(self) -> ColoredString
where Self: Sized { ... }
fn on_bright_yellow(self) -> ColoredString
where Self: Sized { ... }
fn on_bright_blue(self) -> ColoredString
where Self: Sized { ... }
fn on_bright_magenta(self) -> ColoredString
where Self: Sized { ... }
fn on_bright_purple(self) -> ColoredString
where Self: Sized { ... }
fn on_bright_cyan(self) -> ColoredString
where Self: Sized { ... }
fn on_bright_white(self) -> ColoredString
where Self: Sized { ... }
}
Expand description
The trait that enables something to be given color.
You can use colored
effectively simply by importing this trait
and then using its methods on String
and &str
.
Required Methods§
fn color<S: Into<Color>>(self, color: S) -> ColoredString
fn on_color<S: Into<Color>>(self, color: S) -> ColoredString
fn clear(self) -> ColoredString
fn normal(self) -> ColoredString
fn bold(self) -> ColoredString
fn dimmed(self) -> ColoredString
fn italic(self) -> ColoredString
fn underline(self) -> ColoredString
fn blink(self) -> ColoredString
sourcefn reverse(self) -> ColoredString
fn reverse(self) -> ColoredString
Historical name of Colorize::reversed
. May be removed in a future version. Please use
Colorize::reversed
instead
sourcefn reversed(self) -> ColoredString
fn reversed(self) -> ColoredString
This should be preferred to Colorize::reverse
.