Trait image2::Color[][src]

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

    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

Associated Constants

Color name

Number of channels

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