Enum ncursesw::extend::Color [−][src]
Variants
TerminalDefault
Dark(BaseColor)
Tuple Fields
0: BaseColor
Light(BaseColor)
Tuple Fields
0: BaseColor
Custom(i32)
Tuple Fields
0: i32
Implementations
Trait Implementations
Return the colors (foreground and background) of the color pair.
Example
extern crate ncursesw;
use ncursesw::*;
use ncursesw::extend::*;
start_color()?;
let blue = Color::Dark(BaseColor::Blue);
let yellow = Color::Dark(BaseColor::Yellow);
let color_pair1 = ColorPair::new(1, Colors::new(blue, yellow))?;
let colors = color_pair1.colors()?;
assert!(colors.foreground() == blue && colors.background() == yellow);
Create a new instance of foreground and background colors.
Foreground color.
Background color.
Parse a string to instance a base color.
Valid values are ‘black’, ‘red’, ‘green’, ‘yellow’, ‘blue’, ‘magenta’, ‘cyan’, ‘white’, ‘light black’, ‘light red’, ‘light green’, ‘light yellow’, ‘light blue’, ‘light magenta’, ‘light cyan’, ‘light white’.
Example
use std::str::FromStr;
let red = Color::from_str("red")?;
let green = Color::from_str("green")?;
let blue = Color::from_str("blue")?;
assert!(red == Color::Dark(BaseColor::Red));
assert!(green == Color::Dark(BaseColor::Green));
assert!(blue == Color::Dark(BaseColor::Blue));
type Err = NCurseswError
type Err = NCurseswError
The associated error which can be returned from parsing.
Auto Trait Implementations
impl RefUnwindSafe for Color
impl UnwindSafe for Color
Blanket Implementations
Mutably borrows from an owned value. Read more