Trait colorsys::ColorTransform
source · 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§
sourcefn lighten(&mut self, amt: f64)
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
sourcefn saturate(&mut self, sat: SaturationInSpace)
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.
sourcefn adjust_hue(&mut self, hue: f64)
fn adjust_hue(&mut self, hue: f64)
increase/decrease color tone. Value is degree - -360..360
.
sourcefn grayscale_simple(&mut self)
fn grayscale_simple(&mut self)
Brings color to a shade of gray. For more specific grayscale methods see Rgb.grayscale