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.

Loading content...

Implementors

impl<C: Clamp, T: Component> Clamp for Alpha<C, T>[src]

impl<S, T> Clamp for Luma<S, T> where
    T: Component,
    S: LumaStandard
[src]

impl<S, T> Clamp for Rgb<S, T> where
    S: RgbStandard,
    T: Component
[src]

impl<S, T> Clamp for Hsl<S, T> where
    T: FloatComponent,
    S: RgbStandard
[src]

impl<S, T> Clamp for Hsv<S, T> where
    T: FloatComponent,
    S: RgbStandard
[src]

impl<S, T> Clamp for Hwb<S, T> where
    T: FloatComponent,
    S: RgbStandard
[src]

impl<Wp, T> Clamp for Hsluv<Wp, T> where
    T: FloatComponent,
    Wp: WhitePoint
[src]

impl<Wp, T> Clamp for Lab<Wp, T> where
    T: FloatComponent,
    Wp: WhitePoint
[src]

impl<Wp, T> Clamp for Lch<Wp, T> where
    T: FloatComponent,
    Wp: WhitePoint
[src]

impl<Wp, T> Clamp for Lchuv<Wp, T> where
    T: FloatComponent,
    Wp: WhitePoint
[src]

impl<Wp, T> Clamp for Luv<Wp, T> where
    T: FloatComponent,
    Wp: WhitePoint
[src]

impl<Wp, T> Clamp for Xyz<Wp, T> where
    T: FloatComponent,
    Wp: WhitePoint
[src]

impl<Wp, T> Clamp for Yxy<Wp, T> where
    T: FloatComponent,
    Wp: WhitePoint
[src]

Loading content...