Enum ncursesw::BaseColor [−][src]
#[repr(i16)]
pub enum BaseColor {
Black,
Red,
Green,
Yellow,
Blue,
Magenta,
Cyan,
White,
}
Expand description
One of the 8 base colors.
Variants
Black
Black color
Color #0
Red
Red color
Color #1
Green
Green color
Color #2
Yellow
Yellow color (Red + Green)
Color #3
Blue
Blue color
Color #4
Magenta
Magenta color (Red + Blue)
Color #5
Cyan
Cyan color (Green + Blue)
Color #6
White
White color (Red + Green + Blue)
Color #7
Trait Implementations
Parse a string to instance a base color.
Valid values are ‘black’, ‘red’, ‘green’, ‘yellow’, ‘blue’, ‘magenta’, ‘cyan’, ‘white’
Example
use std::str::FromStr;
let red = BaseColor::from_str("red")?;
let green = BaseColor::from_str("green")?;
let blue = BaseColor::from_str("blue")?;
assert!(red == BaseColor::Red);
assert!(green == BaseColor::Green);
assert!(blue == BaseColor::Blue);
type Err = NCurseswError
type Err = NCurseswError
The associated error which can be returned from parsing.
Auto Trait Implementations
impl RefUnwindSafe for BaseColor
impl UnwindSafe for BaseColor
Blanket Implementations
Mutably borrows from an owned value. Read more