Trait palette::Clamp [−][src]
pub trait Clamp { fn is_within_bounds(&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_within_bounds(&self) -> bool
[src]
Check if the color’s components are within the expected clamped range bounds.
fn clamp(&self) -> Self
[src]
Return a new color where the components have been clamped to the nearest valid values.
fn clamp_self(&mut self)
[src]
Clamp the color’s components to the nearest valid values.
Implementors
impl<C: Clamp, T: Component> Clamp for Alpha<C, T>
[src]
impl<C: Clamp, T: Component> Clamp for Alpha<C, T>
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Alpha<C, T>
[src]
fn clamp_self(&mut self)
[src]
impl<S, T> Clamp for Luma<S, T> where
T: Component,
S: LumaStandard,
[src]
impl<S, T> Clamp for Luma<S, T> where
T: Component,
S: LumaStandard,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Luma<S, T>
[src]
fn clamp_self(&mut self)
[src]
impl<S, T> Clamp for Rgb<S, T> where
S: RgbStandard,
T: Component,
[src]
impl<S, T> Clamp for Rgb<S, T> where
S: RgbStandard,
T: Component,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Rgb<S, T>
[src]
fn clamp_self(&mut self)
[src]
impl<S, T> Clamp for Hsl<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]
impl<S, T> Clamp for Hsl<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Hsl<S, T>
[src]
fn clamp_self(&mut self)
[src]
impl<S, T> Clamp for Hsv<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]
impl<S, T> Clamp for Hsv<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Hsv<S, T>
[src]
fn clamp_self(&mut self)
[src]
impl<S, T> Clamp for Hwb<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]
impl<S, T> Clamp for Hwb<S, T> where
T: FloatComponent,
S: RgbStandard,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Hwb<S, T>
[src]
fn clamp_self(&mut self)
[src]
impl<Wp, T> Clamp for Hsluv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Clamp for Hsluv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Hsluv<Wp, T>
[src]
fn clamp_self(&mut self)
[src]
impl<Wp, T> Clamp for Lab<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Clamp for Lab<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Lab<Wp, T>
[src]
fn clamp_self(&mut self)
[src]
impl<Wp, T> Clamp for Lch<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Clamp for Lch<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Lch<Wp, T>
[src]
fn clamp_self(&mut self)
[src]
impl<Wp, T> Clamp for Lchuv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Clamp for Lchuv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Lchuv<Wp, T>
[src]
fn clamp_self(&mut self)
[src]
impl<Wp, T> Clamp for Luv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Clamp for Luv<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Luv<Wp, T>
[src]
fn clamp_self(&mut self)
[src]
impl<Wp, T> Clamp for Xyz<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Clamp for Xyz<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]fn is_within_bounds(&self) -> bool
[src]
fn clamp(&self) -> Xyz<Wp, T>
[src]
fn clamp_self(&mut self)
[src]
impl<Wp, T> Clamp for Yxy<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]
impl<Wp, T> Clamp for Yxy<Wp, T> where
T: FloatComponent,
Wp: WhitePoint,
[src]