[−][src]Enum crossterm::style::Colored
Represents a foreground or background color.
This can be converted to a Colors by calling into()
and applied
using the SetColors command.
Variants
ForegroundColor(Color)
A foreground color.
BackgroundColor(Color)
A background color.
Implementations
impl Colored
[src]
pub fn parse_ansi(ansi: &str) -> Option<Self>
[src]
Parse an ANSI foreground or background color.
This is the string that would appear within an ESC [ <str> m
escape sequence, as found in
various configuration files.
For example:
38;5;0 -> ForegroundColor(Black)
,38;5;26 -> ForegroundColor(AnsiValue(26))
48;2;50;60;70 -> BackgroundColor(Rgb(50, 60, 70))
49 -> BackgroundColor(Reset)
Invalid sequences map toNone
.
Currently, 3/4 bit color values aren't supported so return None
.
See also: Color::parse_ansi
Trait Implementations
impl Clone for Colored
[src]
impl Copy for Colored
[src]
impl Debug for Colored
[src]
impl<'de> Deserialize<'de> for Colored
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Colored
[src]
impl Eq for Colored
[src]
impl From<Colored> for u16
[src]
pub fn from(colored: Colored) -> Self
[src]
Returns the WinAPI color value (u16) from the Colored
struct.
impl From<Colored> for Colors
[src]
impl Hash for Colored
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Colored
[src]
pub fn cmp(&self, other: &Colored) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Colored> for Colored
[src]
impl PartialOrd<Colored> for Colored
[src]
pub fn partial_cmp(&self, other: &Colored) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Colored) -> bool
[src]
pub fn le(&self, other: &Colored) -> bool
[src]
pub fn gt(&self, other: &Colored) -> bool
[src]
pub fn ge(&self, other: &Colored) -> bool
[src]
impl Serialize for Colored
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Colored
[src]
impl StructuralPartialEq for Colored
[src]
Auto Trait Implementations
impl RefUnwindSafe for Colored
[src]
impl Send for Colored
[src]
impl Sync for Colored
[src]
impl Unpin for Colored
[src]
impl UnwindSafe for Colored
[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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,