Enum term_painter::Color
source · pub enum Color {
Show 18 variants
NotSet,
Black,
Red,
Green,
Yellow,
Blue,
Magenta,
Cyan,
White,
BrightBlack,
BrightRed,
BrightGreen,
BrightYellow,
BrightBlue,
BrightMagenta,
BrightCyan,
BrightWhite,
Custom(u32),
}
Expand description
Lists all possible Colors. It implements ToStyle
so it’s possible to call
ToStyle
’s methods directly on a Color
variant like:
println!("{}", Color::Red.bold().paint("Red and bold"));
It is not guaranteed that the local terminal supports all of those colors.
As already mentioned in the module documentation, you should use term
directly to check the terminal’s capabilities.
Note: Using Color::NotSet
will not reset the color to the default
terminal color.
Variants§
NotSet
Black
Red
Green
Yellow
Blue
Magenta
Cyan
White
BrightBlack
BrightRed
BrightGreen
BrightYellow
BrightBlue
BrightMagenta
BrightCyan
BrightWhite
Custom(u32)
Trait Implementations§
source§impl PartialEq for Color
impl PartialEq for Color
source§impl ToStyle for Color
impl ToStyle for Color
source§fn to_style(self) -> Style
fn to_style(self) -> Style
Returns a Style with default values and the self
color as foreground
color.
source§fn to_mapped_style<F>(self, func: F) -> Style
fn to_mapped_style<F>(self, func: F) -> Style
Convenience method for modifying the style before it’s returned.
source§fn not_underline(self) -> Style
fn not_underline(self) -> Style
Removes underline-attribute.
impl Copy for Color
impl Eq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin 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