Trait ColorTransform

Source
pub trait ColorTransform {
    // Required methods
    fn lighten(&mut self, amt: f64);
    fn saturate(&mut self, sat: SaturationInSpace);
    fn adjust_hue(&mut self, hue: f64);
    fn grayscale_simple(&mut self);
    fn invert(&mut self);
}
Expand description

A collection of methods to some special modification of color. Some methods (like saturate, lighten, etc.) requires (inside implementation) converting to another color space and vice versa.

Required Methods§

Source

fn lighten(&mut self, amt: f64)

Makes color lighter or (if amt is negative) darker. Amt is percent - 1..100 to make color lighter; -100..-1 for blacking-out

Source

fn saturate(&mut self, sat: SaturationInSpace)

Saturate/desaturate color. Value is percent: -100..100. You need specify in what color space you want to increase/decrease saturation.

Source

fn adjust_hue(&mut self, hue: f64)

increase/decrease color tone. Value is degree - -360..360.

Source

fn grayscale_simple(&mut self)

Brings color to a shade of gray. For more specific grayscale methods see Rgb.grayscale

Source

fn invert(&mut self)

Just inverts color

Implementors§