pub enum AnsiColor {
Show 16 variants
Black,
Red,
Green,
Yellow,
Blue,
Magenta,
Cyan,
White,
BrightBlack,
BrightRed,
BrightGreen,
BrightYellow,
BrightBlue,
BrightMagenta,
BrightCyan,
BrightWhite,
}Expand description
Standard 16-color ANSI palette
Provides the standard ANSI color set with both normal and bright variants.
Variants§
Black
Standard black (typically #000000)
Red
Standard red (typically #800000)
Green
Standard green (typically #008000)
Yellow
Standard yellow (typically #808000)
Blue
Standard blue (typically #000080)
Magenta
Standard magenta (typically #800080)
Cyan
Standard cyan (typically #008080)
White
Standard white (typically #c0c0c0)
BrightBlack
Bright/bold black, also known as gray (typically #808080)
BrightRed
Bright/bold red (typically #ff0000)
BrightGreen
Bright/bold green (typically #00ff00)
BrightYellow
Bright/bold yellow (typically #ffff00)
BrightBlue
Bright/bold blue (typically #0000ff)
BrightMagenta
Bright/bold magenta (typically #ff00ff)
BrightCyan
Bright/bold cyan (typically #00ffff)
BrightWhite
Bright/bold white (typically #ffffff)
Implementations§
Source§impl AnsiColor
impl AnsiColor
Sourcepub fn to_rgb(&self) -> (u8, u8, u8)
pub fn to_rgb(&self) -> (u8, u8, u8)
Convert ANSI color to RGB values
Returns a tuple of (r, g, b) values for the color. Uses a standard terminal color palette.
§Example
use scarab_plugin_api::status_bar::AnsiColor;
let (r, g, b) = AnsiColor::BrightBlue.to_rgb();
assert_eq!((r, g, b), (0, 0, 255));