#[repr(u8)]pub enum NamedColor {
Show 16 variants
Black = 0,
Red = 1,
Green = 2,
Yellow = 3,
Blue = 4,
Magenta = 5,
Cyan = 6,
White = 7,
BrightBlack = 8,
BrightRed = 9,
BrightGreen = 10,
BrightYellow = 11,
BrightBlue = 12,
BrightMagenta = 13,
BrightCyan = 14,
BrightWhite = 15,
}Expand description
The 16 themeable palette slots (ANSI 0-15).
Split out from Color::Idx by numeric range, not by how the escape
sequence spelled it, so SGR 31 and SGR 38;5;1 both land here.
The backends do not agree on whether that spelling survives parsing:
alacritty keeps it (Named vs Indexed) and so does xterm.js (CM_P16
vs CM_P256), but ghostty flattens both into one .palette value. A model
that preserved the distinction would therefore be unimplementable on
ghostty. The usual reason to want it, painting bold text bright, does not
need it either: ghostty keys that off the index (bold && idx < 8 => palette[idx + 8]), which applies to 38;5;1 just as much as to 31.
What every supported backend agrees on is that 0-15 are the slots a theme may override, which is the only distinction any consumer here acts on.
Variants§
Black = 0
Red = 1
Green = 2
Yellow = 3
Blue = 4
Magenta = 5
Cyan = 6
White = 7
BrightBlack = 8
BrightRed = 9
BrightGreen = 10
BrightYellow = 11
BrightBlue = 12
BrightMagenta = 13
BrightCyan = 14
BrightWhite = 15
Implementations§
Source§impl NamedColor
impl NamedColor
Trait Implementations§
Source§impl Clone for NamedColor
impl Clone for NamedColor
Source§fn clone(&self) -> NamedColor
fn clone(&self) -> NamedColor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for NamedColor
Source§impl Debug for NamedColor
impl Debug for NamedColor
impl Eq for NamedColor
Source§impl PartialEq for NamedColor
impl PartialEq for NamedColor
impl StructuralPartialEq for NamedColor
Auto Trait Implementations§
impl Freeze for NamedColor
impl RefUnwindSafe for NamedColor
impl Send for NamedColor
impl Sync for NamedColor
impl Unpin for NamedColor
impl UnsafeUnpin for NamedColor
impl UnwindSafe for NamedColor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.