pub enum Color {
Default,
Basic(BasicColor),
Extended(u8),
Rgb(u8, u8, u8),
}Expand description
A color.
Implements From<BasicColor>, From<u8>, and From<(u8, u8, u8)> for convenient construction
of basic colors, extended (256-color palette) colors, and RGB colors respectively.
Variants§
Default
The default color.
Basic(BasicColor)
A color from the basic 16-color palette.
Extended(u8)
A color from the extended 256-color palette.
Rgb(u8, u8, u8)
An RGB color.
Implementations§
Source§impl Color
impl Color
Sourcepub const fn is_default(&self) -> bool
pub const fn is_default(&self) -> bool
Check if this color is the default color.
Returns true if this color is Color::Default, otherwise returns false.
Sourcepub const fn bright(self) -> Self
pub const fn bright(self) -> Self
Return the bright variant of this color if applicable.
Otherwise, return the color itself.
Sourcepub const fn not_bright(self) -> Self
pub const fn not_bright(self) -> Self
Return the non-bright variant of this color if applicable.
Otherwise, return the color itself.
Trait Implementations§
Source§impl From<BasicColor> for Color
impl From<BasicColor> for Color
Source§fn from(color: BasicColor) -> Self
fn from(color: BasicColor) -> Self
Converts to this type from the input type.
Source§impl Ord for Color
impl Ord for Color
Source§impl PartialOrd for Color
impl PartialOrd for Color
impl Copy for Color
impl Eq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more