Trait nannou::color::Saturate [−][src]
pub trait Saturate { type Scalar: Float; fn saturate(&self, factor: Self::Scalar) -> Self; fn desaturate(&self, factor: Self::Scalar) -> Self { ... } }
Expand description
A trait for colors where the saturation (or chroma) can be manipulated without conversion.
use palette::{Hsv, Saturate}; let a = Hsv::new(0.0, 0.25, 1.0); let b = Hsv::new(0.0, 1.0, 1.0); assert_eq!(a.saturate(1.0), b.desaturate(0.5));
Associated Types
Required methods
Provided methods
fn desaturate(&self, factor: Self::Scalar) -> Self
fn desaturate(&self, factor: Self::Scalar) -> Self
Decrease the saturation by factor
.