pub enum Color {
Default,
Indexed(u8),
Rgb(u8, u8, u8),
}Expand description
A cell’s foreground or background colour, stored as a reference.
Deliberately exhaustive (#843). Default / Indexed / Rgb is the whole
VT colour-reference space, and a consumer that silently ignored a fourth form
would draw the wrong colour. Here the compiler forcing the match is the
protection rather than the cost, which is the half of #843’s rule that decides
against the attribute. Left exhaustive on purpose, not by omission.
Variants§
Default
The scheme’s default fg/bg — resolved downstream.
Indexed(u8)
A slot in the 256-colour palette (0..=15 are the named ANSI colours, 16..=255 the cube + greyscale). The renderer maps it to hex.
Rgb(u8, u8, u8)
A direct 24-bit truecolour triple.
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