pub enum Color {
Default,
Ansi(AnsiColor),
Indexed(u8),
Rgb {
r: u8,
g: u8,
b: u8,
},
}Expand description
Represents a color in the terminal grid.
Variants§
Default
Backend’s default foreground/background color.
This tells the rendering backend to use the terminal’s configured default colors (e.g., the user’s background color preference).
Ansi(AnsiColor)
One of the 16 standard ANSI colors.
Use these to respect the user’s terminal theme.
Indexed(u8)
256-color palette index.
Rgb
24-bit RGB color.
Use this for exact color matching regardless of terminal settings.
Implementations§
Source§impl Color
impl Color
Sourcepub const BRIGHT_BLACK: Self
pub const BRIGHT_BLACK: Self
Bright Black / dark grey (ANSI).
Sourcepub const BRIGHT_RED: Self
pub const BRIGHT_RED: Self
Bright Red (ANSI).
Sourcepub const BRIGHT_GREEN: Self
pub const BRIGHT_GREEN: Self
Bright Green (ANSI).
Sourcepub const BRIGHT_YELLOW: Self
pub const BRIGHT_YELLOW: Self
Bright Yellow (ANSI).
Sourcepub const BRIGHT_BLUE: Self
pub const BRIGHT_BLUE: Self
Bright Blue (ANSI).
Sourcepub const BRIGHT_MAGENTA: Self
pub const BRIGHT_MAGENTA: Self
Bright Magenta (ANSI).
Sourcepub const BRIGHT_CYAN: Self
pub const BRIGHT_CYAN: Self
Bright Cyan (ANSI).
Sourcepub const BRIGHT_WHITE: Self
pub const BRIGHT_WHITE: Self
Bright White (ANSI).
Trait Implementations§
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 UnsafeUnpin 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