pub enum Fg {
Rgb(u8, u8, u8),
Indexed(u8),
Basic(u8),
}Expand description
A foreground colour, resolved to whatever the terminal can show.
Written as its own SGR sequence rather than through a crossterm command:
crossterm routes colour through the Win32 console API when virtual-terminal
processing is unavailable, which cannot work when the sink is an arbitrary
writer, and this crate is VT-only anyway (the alternate screen and DEC 2026
synchronized output have no console-API equivalent). Emitting the bytes
directly also makes every renderer testable against a plain Vec<u8>.
Variants§
Rgb(u8, u8, u8)
24-bit colour.
Indexed(u8)
An index into the 256-colour palette.
Basic(u8)
One of the 16 basic colours.
Trait Implementations§
impl Copy for Fg
impl Eq for Fg
impl StructuralPartialEq for Fg
Auto Trait Implementations§
impl Freeze for Fg
impl RefUnwindSafe for Fg
impl Send for Fg
impl Sync for Fg
impl Unpin for Fg
impl UnsafeUnpin for Fg
impl UnwindSafe for Fg
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