[−][src]Enum meli::terminal::Color
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
Byte(u8)
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]
D: Deserializer<'de>,
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]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl DotAddressable for Color
[src]
impl Eq for Color
[src]
impl From<Color> for ThemeValue<Color>
[src]
impl Hash for Color
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
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 Serialize for Color
[src]
impl StructuralEq for Color
[src]
impl StructuralPartialEq for Color
[src]
impl ThemeLink for Color
[src]
A color value that's a link can either refer to .fg or .bg field
type LinkType = ColorField
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]
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[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.
fn to_owned(&self) -> T
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,