[][src]Enum anes::Color

pub enum Color {
    Default,
    Black,
    DarkRed,
    DarkGreen,
    DarkYellow,
    DarkBlue,
    DarkMagenta,
    DarkCyan,
    DarkGray,
    Gray,
    Red,
    Green,
    Yellow,
    Blue,
    Magenta,
    Cyan,
    White,
    Ansi(u8),
    Rgb(u8u8u8),
}

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(u8u8u8)

An RGB color.

See 24-bit for more information.

Trait Implementations

impl Clone for Color[src]

impl Copy for Color[src]

impl Eq for Color[src]

impl PartialEq<Color> for Color[src]

impl Display for Color[src]

impl Debug for Color[src]

impl Hash for Color[src]

impl StructuralPartialEq for Color[src]

impl StructuralEq for Color[src]

Auto Trait Implementations

impl Send for Color

impl Sync for Color

impl Unpin for Color

impl UnwindSafe for Color

impl RefUnwindSafe for Color

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]