Function ncursesw::assume_default_colors [−][src]
pub fn assume_default_colors<S, C, T>(colors: S) -> Result<(), NCurseswError> where
S: ColorsType<C, T>,
C: ColorType<T>,
T: ColorAttributeTypes,
Expand description
Assign the colors given as the default foreground and background colors of color pair 0
For both normal and extended color types the foreground or background color may be set
as Color::TerminalDefault
this will default the color before initscr()
was called.
Example
extern crate ncursesw;
use ncursesw::*;
use ncursesw::normal::*;
start_color()?;
let yellow = Color::Dark(BaseColor::Yellow);
let blue = Color::Dark(BaseColor::Blue);
let colors = Colors::new(yellow, blue);
assume_default_colors(colors)?;
let color_pair0 = ColorPair::default();
assert!(color_pair0.colors()?.foreground() == yellow);
assert!(color_pair0.colors()?.background() == blue);