Enum term_painter::Color [] [src]

pub enum Color {
    NotSet,
    Black,
    Red,
    Green,
    Yellow,
    Blue,
    Magenta,
    Cyan,
    White,
    BrightBlack,
    BrightRed,
    BrightGreen,
    BrightYellow,
    BrightBlue,
    BrightMagenta,
    BrightCyan,
    BrightWhite,
    Custom(u16),
}

Lists all possible Colors. It implements ToStyle so it's possible to call ToStyle's methods directly on a Color variant like:


println!("{}", Color::Red.bold().paint("Red and bold"));

It is not guaranteed that the local terminal supports all of those colors. As already mentioned in the module documentation, you should use term directly to check the terminal's capabilities.

Note: Using Color::NotSet will not reset the color to the default terminal color.

Variants

Trait Implementations

impl Debug for Color
[src]

Formats the value using the given formatter.

impl Copy for Color
[src]

impl Clone for Color
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Color
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Color
[src]

impl Default for Color
[src]

Returns the "default value" for a type. Read more

impl ToStyle for Color
[src]

Returns a Style with default values and the self color as foreground color.

Convenience method for modifying the style before it's returned.

Sets the foreground (text) color.

Sets the background color.

Makes the text bold.

Dim mode.

Underlines the text.

Removes underline-attribute.

Underlines the text.

Underlines the text.

Secure mode.

Wraps the style specified in self and something of arbitrary type into a Painted. When Painted is printed it will print the arbitrary something with the given style. Read more

Executes the given function, applying the style information before calling it and resetting after it finished. Read more