Struct ncursesw::normal::ColorPair [−][src]
pub struct ColorPair { /* fields omitted */ }
Implementations
Trait Implementations
Implement the | operator for combining a ColorPair
and a Attribute
to produce Attributes
Example
let colors1 = Colors::new(Color::Red, Color::Black);
let color_pair1 = ColorPair::new(1, colors1)?;
let attributes = Attribute::Blink | color_pair1;
assert!(!attributes.is_bold());
assert!(attributes.is_blink());
Implement the | operator for combining a ColorPair
and an Attribute
to produce Attributes
Example
let colors5 = Colors::new(Color::Red, Color::Black);
let attributes = ColorPair::new(5, &colors5) | Attribute::Blink;
assert!(attributes.color_pair() == 5);
assert!(!attributes.is_bold());
assert!(attributes.is_blink());
Implement the | operator for setting a color pair on an Attributes
object
Note: as only one color pair can be applied to attributes at any one time any previously Or’d color_pair will be Xor’d out of the attributes before Or’ing the new color pair..
Example
let colors1 = Colors::new(Color::Red, Color::Black);
let color_pair0 = ColorPair::default();
let color_pair1 = ColorPair::new(1, &colors1)?;
let mut attributes = Attribute::Normal;
assert!(attributes.color_pair() == color_pair0);
attributes = attributes | color_pair1
assert!(attributes.color_pair() == color_pair1);
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for ColorPair
impl UnwindSafe for ColorPair
Blanket Implementations
Mutably borrows from an owned value. Read more