Enum rustc_errors::Color
source · pub enum Color {
Black,
Blue,
Green,
Red,
Cyan,
Magenta,
Yellow,
White,
Ansi256(u8),
Rgb(u8, u8, u8),
// some variants omitted
}
Expand description
The set of available colors for the terminal foreground/background.
The Ansi256
and Rgb
colors will only output the correct codes when
paired with the Ansi
WriteColor
implementation.
The Ansi256
and Rgb
color types are not supported when writing colors
on Windows using the console. If they are used on Windows, then they are
silently ignored and no colors will be emitted.
This set may expand over time.
This type has a FromStr
impl that can parse colors from their human
readable form. The format is as follows:
- Any of the explicitly listed colors in English. They are matched case insensitively.
- A single 8-bit integer, in either decimal or hexadecimal format.
- A triple of 8-bit integers separated by a comma, where each integer is in decimal or hexadecimal format.
Hexadecimal numbers are written with a 0x
prefix.
Variants§
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
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: 4 bytes
Size for each variant:
Black
: 0 bytesBlue
: 0 bytesGreen
: 0 bytesRed
: 0 bytesCyan
: 0 bytesMagenta
: 0 bytesYellow
: 0 bytesWhite
: 0 bytesAnsi256
: 1 byteRgb
: 3 bytes__Nonexhaustive
: 0 bytes