Enum yacll::stylize::Color

source ·
pub enum Color {
Show 19 variants Reset, Black, DarkGrey, Red, DarkRed, Green, DarkGreen, Yellow, DarkYellow, Blue, DarkBlue, Magenta, DarkMagenta, Cyan, DarkCyan, White, Grey, Rgb { r: u8, g: u8, b: u8, }, AnsiValue(u8),
}
Expand description

Represents a color.

Platform-specific Notes

The following list of 16 base colors are available for almost all terminals (Windows 7 and 8 included).

LightDark
DarkGreyBlack
RedDarkRed
GreenDarkGreen
YellowDarkYellow
BlueDarkBlue
MagentaDarkMagenta
CyanDarkCyan
WhiteGrey

Most UNIX terminals and Windows 10 consoles support additional colors. See Color::Rgb or Color::AnsiValue for more info.

Variants

Reset

Resets the terminal color.

Black

Black color.

DarkGrey

Dark grey color.

Red

Light red color.

DarkRed

Dark red color.

Green

Light green color.

DarkGreen

Dark green color.

Yellow

Light yellow color.

DarkYellow

Dark yellow color.

Blue

Light blue color.

DarkBlue

Dark blue color.

Magenta

Light magenta color.

DarkMagenta

Dark magenta color.

Cyan

Light cyan color.

DarkCyan

Dark cyan color.

White

White color.

Grey

Grey color.

Rgb

Fields

r: u8
g: u8
b: u8

An RGB color. See RGB color model for more info.

Most UNIX terminals and Windows 10 supported only. See Platform-specific notes for more info.

AnsiValue(u8)

An ANSI color. See 256 colors - cheat sheet for more info.

Most UNIX terminals and Windows 10 supported only. See Platform-specific notes for more info.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.