Struct ncursesw::extend::ColorPair [−][src]
pub struct ColorPair { /* fields omitted */ }
Expand description
A extended color pair.
Implementations
Create a new extended color pair.
Example
extern crate ncursesw;
use ncursesw::*;
use ncursesw::normal::*;
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);
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);
Return the number 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!(color_pair1.number() == 1);
Auto Trait Implementations
impl RefUnwindSafe for ColorPair
impl UnwindSafe for ColorPair
Blanket Implementations
Mutably borrows from an owned value. Read more