Trait palette::Limited
[−]
[src]
pub trait Limited {
fn is_valid(&self) -> bool;
fn clamp(&self) -> Self;
fn clamp_self(&mut self);
}A trait for clamping and checking if colors are within their ranges.
Required Methods
fn is_valid(&self) -> bool
Check if the color's components are within the expected ranges.
fn clamp(&self) -> Self
Return a new color where the components has been clamped to the nearest valid values.
fn clamp_self(&mut self)
Clamp the color's components to the nearest valid values.
Implementors
impl<C: Limited, T: Float> Limited for Alpha<C, T>impl<T: Float> Limited for Rgb<T>impl<T: Float> Limited for Luma<T>impl<T: Float> Limited for Yxy<T>impl<T: Float> Limited for Xyz<T>impl<T: Float> Limited for Lab<T>impl<T: Float> Limited for Lch<T>impl<T: Float> Limited for Hsv<T>impl<T: Float> Limited for Hsl<T>impl<T: Float> Limited for Hwb<T>