[−][src]Enum cursive::theme::Color
Represents a color used by the theme.
Variants
Represents a color, preset by terminal.
Dark(BaseColor)
One of the 8 base colors.
These colors should work on any terminal.
Note: the actual color used depends on the terminal configuration.
Light(BaseColor)
Lighter version of a base color.
The native linux TTY usually doesn't support these colors, but almost all terminal emulators should.
Note: the actual color used depends on the terminal configuration.
True-color, 24-bit.
On terminals that don't support this, the color will be "downgraded" to the closest one available.
Low-resolution color.
Each value should be <= 5
(you'll get panics otherwise).
These 216 possible colors are part of the default color palette (256 colors).
Implementations
impl Color
[src]
pub fn from_256colors(n: u8) -> Color
[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 low_res(r: u8, g: u8, b: u8) -> Option<Color>
[src]
Creates a Color::RgbLowRes
from the given values for red, green and
blue.
Returns None
if any of the values exceeds 5.
pub fn parse(value: &str) -> Option<Color>
[src]
Parse a string into a color.
Examples:
"red"
becomesColor::Dark(BaseColor::Red)
"light green"
becomesColor::Light(BaseColor::Green)
"default"
becomesColor::TerminalDefault
"#123456"
becomesColor::Rgb(0x12, 0x34, 0x56)
Trait Implementations
impl Clone for Color
[src]
impl Copy for Color
[src]
impl Debug for Color
[src]
impl Eq for Color
[src]
impl From<Color> for ColorType
[src]
impl From<Color> for ColorStyle
[src]
pub fn from(color: Color) -> ColorStyle
[src]
impl From<Color> for Style
[src]
impl Hash for Color
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Color> for Color
[src]
impl StructuralEq for Color
[src]
impl StructuralPartialEq for Color
[src]
Auto Trait Implementations
impl RefUnwindSafe for Color
[src]
impl Send for Color
[src]
impl Sync for Color
[src]
impl Unpin for Color
[src]
impl UnwindSafe for Color
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash + ?Sized,
[src]
T: Hash + ?Sized,
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> With for T
[src]
pub fn wrap_with<U, F>(self, f: F) -> U where
F: FnOnce(Self) -> U,
[src]
F: FnOnce(Self) -> U,
pub fn with<F>(self, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
pub fn try_with<E, F>(self, f: F) -> Result<Self, E> where
F: FnOnce(&mut Self) -> Result<(), E>,
[src]
F: FnOnce(&mut Self) -> Result<(), E>,
pub fn with_if<F>(self, condition: bool, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),