Trait palette::cast::ComponentOrder

source ·
pub trait ComponentOrder<C, P> {
    // Required methods
    fn pack(color: C) -> P;
    fn unpack(packed: P) -> C;
}
Expand description

Packs and unpacks color types with some component order.

As an example, RGBA channels may be ordered as ABGR, ARGB, BGRA, or RGBA.

Required Methods§

source

fn pack(color: C) -> P

Combine the components of a color into the packed format.

source

fn unpack(packed: P) -> C

Split the packed color into its separate components.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<C, T> ComponentOrder<C, u8> for T
where T: ComponentOrder<C, [u8; 1]>,

source§

impl<C, T> ComponentOrder<C, u16> for T
where T: ComponentOrder<C, [u8; 2]>,

source§

impl<C, T> ComponentOrder<C, u32> for T
where T: ComponentOrder<C, [u8; 4]>,

source§

impl<C, T> ComponentOrder<C, u64> for T
where T: ComponentOrder<C, [u8; 8]>,

source§

impl<C, T> ComponentOrder<C, u128> for T
where T: ComponentOrder<C, [u8; 16]>,

source§

impl<S, T> ComponentOrder<Alpha<Luma<S, T>, T>, [T; 2]> for Al

source§

impl<S, T> ComponentOrder<Alpha<Luma<S, T>, T>, [T; 2]> for La

source§

impl<S, T> ComponentOrder<Alpha<Rgb<S, T>, T>, [T; 4]> for Abgr

source§

impl<S, T> ComponentOrder<Alpha<Rgb<S, T>, T>, [T; 4]> for Argb

source§

impl<S, T> ComponentOrder<Alpha<Rgb<S, T>, T>, [T; 4]> for Bgra

source§

impl<S, T> ComponentOrder<Alpha<Rgb<S, T>, T>, [T; 4]> for Rgba