Enum comfy_table::Color [−][src]
pub enum Color { }
Expand description
Colors used for styling cell content. Reexport of crossterm’s Color enum. Represents a color.
Platform-specific Notes
The following list of 16 base colors are available for almost all terminals (Windows 7 and 8 included).
Light | Dark |
---|---|
Grey | Black |
Red | DarkRed |
Green | DarkGreen |
Yellow | DarkYellow |
Blue | DarkBlue |
Magenta | DarkMagenta |
Cyan | DarkCyan |
White | DarkWhite |
Most UNIX terminals and Windows 10 consoles support additional colors.
See Color::Rgb
or Color::AnsiValue
for more info.
Variants
Resets the terminal color.
Black color.
Dark grey color.
Light red color.
Dark red color.
Light green color.
Dark green color.
Light yellow color.
Dark yellow color.
Light blue color.
Dark blue color.
Light magenta color.
Dark magenta color.
Light cyan color.
Dark cyan color.
White color.
Grey color.
An RGB color. See RGB color model for more info.
Most UNIX terminals and Windows 10 supported only. See Platform-specific notes for more info.
AnsiValue(u8)
An ANSI color. See 256 colors - cheat sheet for more info.
Most UNIX terminals and Windows 10 supported only. See Platform-specific notes for more info.
Implementations
Colors used for styling cell content. Reexport of crossterm’s Color enum.
Parses an ANSI color sequence.
Examples
use crossterm::style::Color; assert_eq!(Color::parse_ansi("5;0"), Some(Color::Black)); assert_eq!(Color::parse_ansi("5;26"), Some(Color::AnsiValue(26))); assert_eq!(Color::parse_ansi("2;50;60;70"), Some(Color::Rgb { r: 50, g: 60, b: 70 })); assert_eq!(Color::parse_ansi("invalid color"), None);
Currently, 3/4 bit color values aren’t supported so return None
.
See also: Colored::parse_ansi
.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Color
impl UnwindSafe for Color
Blanket Implementations
Mutably borrows from an owned value. Read more