pub trait Colorize {
Show 53 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 truecolor(self, r: u8, g: u8, b: u8) -> ColoredString
where Self: Sized { ... }
fn custom_color<T>(self, color: T) -> ColoredString
where Self: Sized,
T: Into<CustomColor> { ... }
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 { ... }
fn on_truecolor(self, r: u8, g: u8, b: u8) -> ColoredString
where Self: Sized { ... }
fn on_custom_color<T>(self, color: T) -> ColoredString
where Self: Sized,
T: Into<CustomColor> { ... }
}
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
fn reverse(self) -> ColoredString
👎Deprecated since 1.5.2: Users should use reversed instead
fn reversed(self) -> ColoredString
fn strikethrough(self) -> ColoredString
Provided Methods§
fn black(self) -> ColoredStringwhere
Self: Sized,
fn red(self) -> ColoredStringwhere
Self: Sized,
fn green(self) -> ColoredStringwhere
Self: Sized,
fn yellow(self) -> ColoredStringwhere
Self: Sized,
fn blue(self) -> ColoredStringwhere
Self: Sized,
fn magenta(self) -> ColoredStringwhere
Self: Sized,
fn purple(self) -> ColoredStringwhere
Self: Sized,
fn cyan(self) -> ColoredStringwhere
Self: Sized,
fn white(self) -> ColoredStringwhere
Self: Sized,
fn bright_black(self) -> ColoredStringwhere
Self: Sized,
fn bright_red(self) -> ColoredStringwhere
Self: Sized,
fn bright_green(self) -> ColoredStringwhere
Self: Sized,
fn bright_yellow(self) -> ColoredStringwhere
Self: Sized,
fn bright_blue(self) -> ColoredStringwhere
Self: Sized,
fn bright_magenta(self) -> ColoredStringwhere
Self: Sized,
fn bright_purple(self) -> ColoredStringwhere
Self: Sized,
fn bright_cyan(self) -> ColoredStringwhere
Self: Sized,
fn bright_white(self) -> ColoredStringwhere
Self: Sized,
fn truecolor(self, r: u8, g: u8, b: u8) -> ColoredStringwhere
Self: Sized,
fn custom_color<T>(self, color: T) -> ColoredString
fn on_black(self) -> ColoredStringwhere
Self: Sized,
fn on_red(self) -> ColoredStringwhere
Self: Sized,
fn on_green(self) -> ColoredStringwhere
Self: Sized,
fn on_yellow(self) -> ColoredStringwhere
Self: Sized,
fn on_blue(self) -> ColoredStringwhere
Self: Sized,
fn on_magenta(self) -> ColoredStringwhere
Self: Sized,
fn on_purple(self) -> ColoredStringwhere
Self: Sized,
fn on_cyan(self) -> ColoredStringwhere
Self: Sized,
fn on_white(self) -> ColoredStringwhere
Self: Sized,
fn on_bright_black(self) -> ColoredStringwhere
Self: Sized,
fn on_bright_red(self) -> ColoredStringwhere
Self: Sized,
fn on_bright_green(self) -> ColoredStringwhere
Self: Sized,
fn on_bright_yellow(self) -> ColoredStringwhere
Self: Sized,
fn on_bright_blue(self) -> ColoredStringwhere
Self: Sized,
fn on_bright_magenta(self) -> ColoredStringwhere
Self: Sized,
fn on_bright_purple(self) -> ColoredStringwhere
Self: Sized,
fn on_bright_cyan(self) -> ColoredStringwhere
Self: Sized,
fn on_bright_white(self) -> ColoredStringwhere
Self: Sized,
fn on_truecolor(self, r: u8, g: u8, b: u8) -> ColoredStringwhere
Self: Sized,
fn on_custom_color<T>(self, color: T) -> ColoredString
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl Colorize for &str
impl Colorize for &str
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
source§fn reverse(self) -> ColoredString
fn reverse(self) -> ColoredString
👎Deprecated since 1.5.2: Users should use reversed instead