[][src]Enum meli::terminal::Color

pub enum Color {
    Black,
    Red,
    Green,
    Yellow,
    Blue,
    Magenta,
    Cyan,
    White,
    Byte(u8),
    Rgb(u8u8u8),
    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

// 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

Black
Red
Green
Yellow
Blue
Magenta
Cyan
White
Byte(u8)
Rgb(u8u8u8)
Default

Terminal default.

Implementations

impl Color[src]

pub fn as_byte(self) -> u8[src]

Returns the u8 representation of the Color.

pub fn from_byte(val: u8) -> Self[src]

pub fn write_fg(self, stdout: &mut StateStdout) -> Result<()>[src]

pub fn write_bg(self, stdout: &mut StateStdout) -> Result<()>[src]

pub fn as_termion(self) -> AnsiValue[src]

pub fn from_string_de<'de, D>(s: String) -> Result<Self, D::Error> where
    D: Deserializer<'de>, 
[src]

Trait Implementations

impl Clone for Color[src]

impl Copy for Color[src]

impl Debug for Color[src]

impl Default for Color[src]

impl<'de> Deserialize<'de> for Color[src]

impl DotAddressable for Color[src]

impl Eq for Color[src]

impl From<Color> for ThemeValue<Color>[src]

impl Hash for Color[src]

impl PartialEq<Color> for Color[src]

impl Serialize for Color[src]

impl StructuralEq for Color[src]

impl StructuralPartialEq for Color[src]

A color value that's a link can either refer to .fg or .bg field

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

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T> Instrument for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]