Trait palette::ColorSpace [] [src]

pub trait ColorSpace {
    fn is_valid(&self) -> bool;
    fn clamp(&self) -> Self;
    fn clamp_self(&mut self);
}

Common functionality for color spaces.

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