pub enum Color {
Ansi(AnsiColor),
Ansi256(Ansi256Color),
Rgb(RgbColor),
}
Expand description
Any ANSI color code scheme
Variants§
Ansi(AnsiColor)
Available 4-bit ANSI color palette codes
The user’s terminal defines the meaning of the each palette code.
Ansi256(Ansi256Color)
256 (8-bit) color support
Rgb(RgbColor)
24-bit ANSI RGB color codes
Implementations§
Source§impl Color
impl Color
Sourcepub fn on(self, background: impl Into<Color>) -> Style
pub fn on(self, background: impl Into<Color>) -> Style
Create a Style
with this as the foreground
Sourcepub const fn on_default(self) -> Style
pub const fn on_default(self) -> Style
Create a Style
with this as the foreground
pub(crate) fn write_fg_to(self, write: &mut dyn Write) -> Result<()>
pub(crate) fn write_bg_to(self, write: &mut dyn Write) -> Result<()>
pub(crate) fn render_underline(self) -> impl Display + Copy
pub(crate) fn write_underline_to(self, write: &mut dyn Write) -> Result<()>
Trait Implementations§
Source§impl From<Ansi256Color> for Color
impl From<Ansi256Color> for Color
Source§fn from(inner: Ansi256Color) -> Self
fn from(inner: Ansi256Color) -> 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