pub enum Color {
}
Expand description
A color.
This is NOT a full ANSI sequence. Color
must be used along with
the:
§Examples
use std::io::{stdout, Write};
use anes::{Color, SetForegroundColor};
let mut stdout = stdout();
// Set the foreground color to red
write!(stdout, "{}", SetForegroundColor(Color::Red));
Variants§
Default
Default color.
Black
Black color.
DarkRed
Dark red color.
DarkGreen
Dark green color.
DarkYellow
Dark yellow color.
DarkBlue
Dark blue color.
DarkMagenta
Dark magenta color.
DarkCyan
Dark cyan color.
DarkGray
Dark gray color.
Also knows as light (bright) black.
Gray
Light (bright) gray color.
Also known as dark white.
Red
Light (bright) red color.
Green
Light (bright) green color.
Yellow
Light (bright) yellow color.
Blue
Light (bright) blue color.
Magenta
Light (bright) magenta color.
Cyan
Light (bright) cyan color.
White
White color.
Ansi(u8)
A color from the predefined set of ANSI colors.
0 - 7: standard colors (as in ESC [ 30–37 m)
8- 15: high intensity colors (as in ESC [ 90–97 m)
16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5)
232-255: grayscale from black to white in 24 steps
See 8-bit for more information.
Rgb(u8, u8, u8)
An RGB color.
See 24-bit for more information.
Trait Implementations§
impl Copy for Color
impl Eq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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:
Default
: 0 bytesBlack
: 0 bytesDarkRed
: 0 bytesDarkGreen
: 0 bytesDarkYellow
: 0 bytesDarkBlue
: 0 bytesDarkMagenta
: 0 bytesDarkCyan
: 0 bytesDarkGray
: 0 bytesGray
: 0 bytesRed
: 0 bytesGreen
: 0 bytesYellow
: 0 bytesBlue
: 0 bytesMagenta
: 0 bytesCyan
: 0 bytesWhite
: 0 bytesAnsi
: 1 byteRgb
: 3 bytes