#[repr(u8)]pub enum AnsiColor {
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
Available 4-bit ANSI color palette codes
The user’s terminal defines the meaning of the each palette code.
Variants§
Black = 0
Black: #0 (foreground code 30
, background code 40
).
Red = 1
Red: #1 (foreground code 31
, background code 41
).
Green = 2
Green: #2 (foreground code 32
, background code 42
).
Yellow = 3
Yellow: #3 (foreground code 33
, background code 43
).
Blue = 4
Blue: #4 (foreground code 34
, background code 44
).
Magenta = 5
Magenta: #5 (foreground code 35
, background code 45
).
Cyan = 6
Cyan: #6 (foreground code 36
, background code 46
).
White = 7
White: #7 (foreground code 37
, background code 47
).
BrightBlack = 8
Bright black: #0 (foreground code 90
, background code 100
).
BrightRed = 9
Bright red: #1 (foreground code 91
, background code 101
).
BrightGreen = 10
Bright green: #2 (foreground code 92
, background code 102
).
BrightYellow = 11
Bright yellow: #3 (foreground code 93
, background code 103
).
BrightBlue = 12
Bright blue: #4 (foreground code 94
, background code 104
).
BrightMagenta = 13
Bright magenta: #5 (foreground code 95
, background code 105
).
BrightCyan = 14
Bright cyan: #6 (foreground code 96
, background code 106
).
BrightWhite = 15
Bright white: #7 (foreground code 97
, background code 107
).
Implementations§
§impl AnsiColor
impl AnsiColor
pub const fn on_default(self) -> Style
pub const fn on_default(self) -> Style
Create a Style
with this as the foreground
Trait Implementations§
§impl From<AnsiColor> for Ansi256Color
impl From<AnsiColor> for Ansi256Color
§fn from(inner: AnsiColor) -> Ansi256Color
fn from(inner: AnsiColor) -> Ansi256Color
§impl Ord for AnsiColor
impl Ord for AnsiColor
§impl PartialOrd for AnsiColor
impl PartialOrd for AnsiColor
§fn partial_cmp(&self, other: &AnsiColor) -> Option<Ordering>
fn partial_cmp(&self, other: &AnsiColor) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for AnsiColor
impl Eq for AnsiColor
impl StructuralEq for AnsiColor
impl StructuralPartialEq for AnsiColor
Auto Trait Implementations§
impl RefUnwindSafe for AnsiColor
impl Send for AnsiColor
impl Sync for AnsiColor
impl Unpin for AnsiColor
impl UnwindSafe for AnsiColor
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
§impl<T> Clamp for Twhere
T: PartialOrd,
impl<T> Clamp for Twhere
T: PartialOrd,
§fn clamp_range(self, range: impl FixedRangeBounds<Self>) -> Selfwhere
Self: Clone,
fn clamp_range(self, range: impl FixedRangeBounds<Self>) -> Selfwhere
Self: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.