Enum text_terminal::Color
source · pub enum Color {
}
Expand description
The set of colors that can be displayed by a terminal emulator.
- The first 8 variants are 3-bit colors, supported on every terminal emulator.
- The next 8 variants are 4-bit colors, which are brightened (or bold) versions of the first 8.
- After that, the 8-bit color variant accepts any value from 0 to 256, in which values of 0-15 are the same as the first 16 variants of this enum
- Finally, the 24-bit color variant accepts standard RGB values.
See here for the set of colors: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
Variants§
Black
Red
Green
Yellow
Blue
Magenta
Cyan
White
More of a light gray/grey. Use BrightWhite
for true white.
BrightBlack
Gray/grey.
BrightRed
BrightGreen
BrightYellow
BrightBlue
BrightMagenta
BrightCyan
BrightWhite
True pure white.
Color8Bit(u8)
8-bit color, as introduced in xterm.
- Values of
0
through15
are identical to the above 16 color variants. - The next 216 colors
16
through231
are arranged into a 6 x 6 x 6 color cube, as shown here: https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit. - The last 24 colors
232
through255
are grayscale steps from dark gray to light.
This is sometimes referred to as a Palette color lookup table.
RGB
True 24-bit RGB color, with 8 bits for each of the red, green, and blue channels.
Default
The default color, which is generally unspecified and depends on the context in which it is used.
Trait Implementations§
source§impl From<Color> for BackgroundColor
impl From<Color> for BackgroundColor
source§impl From<Color> for ForegroundColor
impl From<Color> for ForegroundColor
source§impl From<Color> for UnderlinedColor
impl From<Color> for UnderlinedColor
source§impl PartialEq<Color> for Color
impl PartialEq<Color> for Color
impl Copy for Color
impl Eq for Color
impl StructuralEq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more