Trait palette::Limited

source ·
pub trait Limited {
    // Required methods
    fn is_valid(&self) -> bool;
    fn clamp(&self) -> Self;
    fn clamp_self(&mut self);
}
Expand description

A trait for clamping and checking if colors are within their ranges.

Required Methods§

source

fn is_valid(&self) -> bool

Check if the color’s components are within the expected ranges.

source

fn clamp(&self) -> Self

Return a new color where the components has been clamped to the nearest valid values.

source

fn clamp_self(&mut self)

Clamp the color’s components to the nearest valid values.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<C: Limited, T: Component> Limited for Alpha<C, T>

source§

impl<S, T> Limited for Luma<S, T>
where T: Component, S: LumaStandard,

source§

impl<S, T> Limited for Rgb<S, T>
where S: RgbStandard, T: Component,

source§

impl<S, T> Limited for Hsl<S, T>
where T: Component + Float, S: RgbSpace,

source§

impl<S, T> Limited for Hsv<S, T>
where T: Component + Float, S: RgbSpace,

source§

impl<S, T> Limited for Hwb<S, T>
where T: Component + Float, S: RgbSpace,

source§

impl<Wp, T> Limited for Lab<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

impl<Wp, T> Limited for Lch<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

impl<Wp, T> Limited for Xyz<Wp, T>
where T: Component + Float, Wp: WhitePoint,

source§

impl<Wp, T> Limited for Yxy<Wp, T>
where T: Component + Float, Wp: WhitePoint,