Trait palette::Saturate
[−]
[src]
pub trait Saturate: Sized { type Scalar: Float; fn saturate(&self, factor: Self::Scalar) -> Self; fn desaturate(&self, factor: Self::Scalar) -> Self { ... } }
A trait for colors where the saturation (or chroma) can be manipulated without conversion.
use palette::{Hsv, Saturate}; let a = Hsv::new(0.0.into(), 0.25, 1.0); let b = Hsv::new(0.0.into(), 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
Decrease the saturation by factor
.
Implementors
impl<C: Saturate> Saturate for Alpha<C, C::Scalar> type Scalar = C::Scalar;
impl<Wp, T> Saturate for Lch<Wp, T> where
T: Float,
Wp: WhitePoint, type Scalar = T;impl<S, T> Saturate for Hsv<S, T> where
T: Float,
S: RgbSpace, type Scalar = T;impl<S, T> Saturate for Hsl<S, T> where
T: Float,
S: RgbSpace, type Scalar = T;impl<S, T> Saturate for Color<S, T> where
T: Float,
S: RgbSpace, type Scalar = T;