[][src]Trait simpleterm::text::TermColor

pub trait TermColor {
    fn brightness(&self) -> f32;
fn brighter_than(&self, other: Color) -> bool; }

Adds brightness functions to PistonWindow's Color type

Required methods

fn brightness(&self) -> f32

Uses a weighted color axis to determine percieved brightness of a color.

assert_eq!(EMERALD.brightness(), 0.6626567);

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));
Loading content...

Implementations on Foreign Types

impl TermColor for Color[src]

Loading content...

Implementors

Loading content...