Enum cursive::theme::Color [−][src]
pub enum Color { TerminalDefault, Dark(BaseColor), Light(BaseColor), Rgb(u8, u8, u8), RgbLowRes(u8, u8, u8), }
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(u8, u8, u8)
True-color, 24-bit.
RgbLowRes(u8, u8, u8)
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]
impl Color
pub fn from_256colors(n: u8) -> Self
[src]
pub fn from_256colors(n: u8) -> Self
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.
Trait Implementations
impl Clone for Color
[src]
impl Clone for Color
fn clone(&self) -> Color
[src]
fn clone(&self) -> Color
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Color
[src]
impl Copy for Color
impl Debug for Color
[src]
impl Debug for Color
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Color
[src]
impl PartialEq for Color
fn eq(&self, other: &Color) -> bool
[src]
fn eq(&self, other: &Color) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Color) -> bool
[src]
fn ne(&self, other: &Color) -> bool
This method tests for !=
.
impl Eq for Color
[src]
impl Eq for Color
impl Hash for Color
[src]
impl Hash for Color
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl From<Color> for ColorStyle
[src]
impl From<Color> for ColorStyle
impl From<Color> for ColorType
[src]
impl From<Color> for ColorType
impl From<Color> for Style
[src]
impl From<Color> for Style