pub enum Color {
TrueColor(TrueColor),
EightBitColor(EightBitColor),
FourBitColor(FourBitColor),
}Expand description
The Color allowing for the different implementations where needed
Variants§
TrueColor(TrueColor)
A True Color terminal color
EightBitColor(EightBitColor)
Eight Bit Color format
FourBitColor(FourBitColor)
Classic Four Bit Color format.
Trait Implementations§
Source§impl DisplayColor for Color
impl DisplayColor for Color
Source§fn fmt_background(&self, f: &mut Formatter<'_>) -> Result
fn fmt_background(&self, f: &mut Formatter<'_>) -> Result
Formats the ansi escape code for the background
On the True Color and Eight Bit it will be the Format
\x1b[48;{}m on the four bit it will use the \x1b[{}m Read moreSource§fn fmt_color(&self, f: &mut Formatter<'_>) -> Result
fn fmt_color(&self, f: &mut Formatter<'_>) -> Result
Formats the ansi escape code for the normal color
On the True Color and Eight Bit it will be the Format
\x1b[38;{}m on the four bit it will use the \x1b[{}m Read moreSource§fn background_color(&self) -> String
fn background_color(&self) -> String
Creates the ANSI escape code as a string
Source§impl From<DefaultColor> for Color
impl From<DefaultColor> for Color
Source§fn from(value: DefaultColor) -> Self
fn from(value: DefaultColor) -> Self
Converts to this type from the input type.
Source§impl From<EightBitColor> for Color
impl From<EightBitColor> for Color
Source§fn from(color: EightBitColor) -> Self
fn from(color: EightBitColor) -> Self
Converts to this type from the input type.
Source§impl From<FourBitColor> for Color
impl From<FourBitColor> for Color
Source§fn from(color: FourBitColor) -> Self
fn from(color: FourBitColor) -> Self
Converts to this type from the input type.
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