pub trait Color: Unpin + PartialEq + Eq + PartialOrd + Ord + Clone + Sync + Send + Debug {
    const NAME: &'static str;
    const CHANNELS: Channel;
    const ALPHA: Option<Channel> = None;

    fn to_rgb(src: &Pixel<Self>, dest: &mut Pixel<Rgb>);
    fn from_rgb(pixel: &Pixel<Rgb>, dest: &mut Pixel<Self>);

    fn convert<ToColor: Color>(src: &Pixel<Self>, dest: &mut Pixel<ToColor>) { ... }
}
Expand description

Color trait is used to define color spaces

Required Associated Constants

Color name

Number of channels

Provided Associated Constants

Index of alpha channel

Required Methods

Convert from Self -> Rgb

Convert from Rgb -> Self

Provided Methods

Convert a single channel of a color to another color

Implementors