pub trait ColorTransform {
    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§

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

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

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

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

Just inverts color

Implementors§