pub trait TermColor {
// Required methods
fn brightness(&self) -> f32;
fn brighter_than(&self, other: Color) -> bool;
}
Expand description
Adds brightness functions to PistonWindow’s Color type
Required Methods§
Sourcefn brightness(&self) -> f32
fn brightness(&self) -> f32
Uses a weighted color axis to determine percieved brightness of a color.
assert_eq!(EMERALD.brightness(), 0.6626567);
Sourcefn brighter_than(&self, other: Color) -> bool
fn brighter_than(&self, other: Color) -> bool
Returns true if this color is brighter than the given other color.
assert!(LIGHT_PURPLE.brighter_than(DARK_PURPLE));