#[repr(u8)]pub enum AnsiColor {
Show 16 variants
Black = 0,
Red = 1,
Green = 2,
Yellow = 3,
Blue = 4,
Magenta = 5,
Cyan = 6,
White = 7,
BrightBlack = 8,
BrightRed = 9,
BrightGreen = 10,
BrightYellow = 11,
BrightBlue = 12,
BrightMagenta = 13,
BrightCyan = 14,
BrightWhite = 15,
}
Expand description
Available 4-bit ANSI color palette codes
The user’s terminal defines the meaning of the each palette code.
Variants§
Black = 0
Black: #0 (foreground code 30
, background code 40
).
Red = 1
Red: #1 (foreground code 31
, background code 41
).
Green = 2
Green: #2 (foreground code 32
, background code 42
).
Yellow = 3
Yellow: #3 (foreground code 33
, background code 43
).
Blue = 4
Blue: #4 (foreground code 34
, background code 44
).
Magenta = 5
Magenta: #5 (foreground code 35
, background code 45
).
Cyan = 6
Cyan: #6 (foreground code 36
, background code 46
).
White = 7
White: #7 (foreground code 37
, background code 47
).
BrightBlack = 8
Bright black: #0 (foreground code 90
, background code 100
).
BrightRed = 9
Bright red: #1 (foreground code 91
, background code 101
).
BrightGreen = 10
Bright green: #2 (foreground code 92
, background code 102
).
BrightYellow = 11
Bright yellow: #3 (foreground code 93
, background code 103
).
BrightBlue = 12
Bright blue: #4 (foreground code 94
, background code 104
).
BrightMagenta = 13
Bright magenta: #5 (foreground code 95
, background code 105
).
BrightCyan = 14
Bright cyan: #6 (foreground code 96
, background code 106
).
BrightWhite = 15
Bright white: #7 (foreground code 97
, background code 107
).
Implementations§
Trait Implementations§
Source§impl From<AnsiColor> for Ansi256Color
impl From<AnsiColor> for Ansi256Color
Source§fn from(inner: AnsiColor) -> Ansi256Color
fn from(inner: AnsiColor) -> Ansi256Color
Source§impl Ord for AnsiColor
impl Ord for AnsiColor
Source§impl PartialOrd for AnsiColor
impl PartialOrd for AnsiColor
impl Copy for AnsiColor
impl Eq for AnsiColor
impl StructuralPartialEq for AnsiColor
Auto Trait Implementations§
impl Freeze for AnsiColor
impl RefUnwindSafe for AnsiColor
impl Send for AnsiColor
impl Sync for AnsiColor
impl Unpin for AnsiColor
impl UnwindSafe for AnsiColor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Black
: 0 bytesRed
: 0 bytesGreen
: 0 bytesYellow
: 0 bytesBlue
: 0 bytesMagenta
: 0 bytesCyan
: 0 bytesWhite
: 0 bytesBrightBlack
: 0 bytesBrightRed
: 0 bytesBrightGreen
: 0 bytesBrightYellow
: 0 bytesBrightBlue
: 0 bytesBrightMagenta
: 0 bytesBrightCyan
: 0 bytesBrightWhite
: 0 bytes