Enum rustty::Color [] [src]

pub enum Color {
    Black,
    Red,
    Green,
    Yellow,
    Blue,
    Magenta,
    Cyan,
    White,
    Byte(u8),
    Default,
}

The color of a Cell.

Color::Default represents the default color of the underlying terminal.

The eight basic colors may be used directly and correspond to 0x00..0x07 in the 8-bit (256) color range; in addition, the eight basic colors coupled with Attr::Bold correspond to 0x08..0x0f in the 8-bit color range.

Color::Byte(..) may be used to specify a color in the 8-bit range.

Examples

use rustty::Color;

// The default color.
let default = Color::Default;

// A basic color.
let red = Color::Red;

// An 8-bit color.
let fancy = Color::Byte(0x01);

// Basic colors are also 8-bit colors (but not vice-versa).
assert_eq!(red.as_byte(), fancy.as_byte())

Variants

Methods

impl Color
[src]

Returns the u8 representation of the Color.

Trait Implementations

impl Debug for Color
[src]

Formats the value using the given formatter.

impl Copy for Color
[src]

impl Clone for Color
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Color
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Color
[src]