[][src]Enum cursive::theme::Color

pub enum Color {
    TerminalDefault,
    Dark(BaseColor),
    Light(BaseColor),
    Rgb(u8u8u8),
    RgbLowRes(u8u8u8),
}

Represents a color used by the theme.

Variants

TerminalDefault

Represents a color, preset by terminal.

Dark(BaseColor)

One of the 8 base colors.

Note: the actual color used depends on the terminal configuration.

Light(BaseColor)

Lighter version of a base color.

Note: the actual color used depends on the terminal configuration.

Rgb(u8u8u8)

True-color, 24-bit.

RgbLowRes(u8u8u8)

Low-resolution

Each value should be <= 5 (you'll get panics otherwise).

These 216 possible colors are part of the default color palette.

Methods

impl Color[src]

pub fn from_256colors(n: u8) -> Self[src]

Creates a color from its ID in the 256 colors list.

  • Colors 0-7 are base dark colors.
  • Colors 8-15 are base light colors.
  • Colors 16-231 are rgb colors with 6 values per channel (216 colors).
  • Colors 232-255 are grayscale colors.

pub fn parse(value: &str) -> Option<Self>[src]

Parse a string into a color.

Examples:

  • "red" becomes Color::Dark(BaseColor::Red)
  • "light green" becomes Color::Light(BaseColor::Green)
  • "default" becomes Color::TerminalDefault
  • "#123456" becomes Color::Rgb(0x12, 0x34, 0x56)

Trait Implementations

impl Clone for Color[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl From<Color> for ColorStyle[src]

impl From<Color> for ColorType[src]

impl From<Color> for Style[src]

impl PartialEq<Color> for Color[src]

impl Copy for Color[src]

impl Eq for Color[src]

impl Debug for Color[src]

impl Hash for Color[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Sync for Color

impl Send for Color

impl Unpin for Color

impl RefUnwindSafe for Color

impl UnwindSafe for Color

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T[src]