cosmic::cosmic_theme::palette::rgb

Type Alias PackedAbgr

source
pub type PackedAbgr<P = u32> = Packed<Abgr, P>;
Expand description

A packed representation of RGBA in ABGR order.

Aliased Type§

struct PackedAbgr<P = u32> {
    pub color: P,
    pub channel_order: PhantomData<Abgr>,
}

Fields§

§color: P

The color packed into a type P, such as u32 or [u8; 4].

§channel_order: PhantomData<Abgr>

The channel order for the color components in the packed data. See ComponentOrder.

Implementations

source§

impl<O, P> Packed<O, P>

source

pub fn pack<C>(color: C) -> Packed<O, P>
where O: ComponentOrder<C, P>,

Transform a color value into a packed memory representation.

source

pub fn unpack<C>(self) -> C
where O: ComponentOrder<C, P>,

Transform a packed color into a regular color value.

Trait Implementations

source§

impl<O, T, const N: usize> ArrayCast for Packed<O, [T; N]>

source§

type Array = [T; N]

The output type of a cast to an array.
source§

impl<O, T, const N: usize> AsMut<[T]> for Packed<O, [T; N]>

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<O, T, const N: usize> AsMut<[T; N]> for Packed<O, [T; N]>

source§

fn as_mut(&mut self) -> &mut [T; N]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<O, P> AsMut<P> for Packed<O, P>
where Packed<O, P>: UintCast<Uint = P>,

source§

fn as_mut(&mut self) -> &mut P

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<O, T, const N: usize> AsRef<[T]> for Packed<O, [T; N]>

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<O, T, const N: usize> AsRef<[T; N]> for Packed<O, [T; N]>

source§

fn as_ref(&self) -> &[T; N]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<O, P> AsRef<P> for Packed<O, P>
where Packed<O, P>: UintCast<Uint = P>,

source§

fn as_ref(&self) -> &P

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<O, P> Clone for Packed<O, P>
where P: Clone,

source§

fn clone(&self) -> Packed<O, P>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<O, P> Debug for Packed<O, P>
where O: Debug, P: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<O, T, const N: usize> From<[T; N]> for Packed<O, [T; N]>

source§

fn from(array: [T; N]) -> Packed<O, [T; N]>

Converts to this type from the input type.
source§

impl<S, T, O, P> From<Alpha<Luma<S, T>, T>> for Packed<O, P>
where O: ComponentOrder<Alpha<Luma<S, T>, T>, P>,

source§

fn from(color: Alpha<Luma<S, T>, T>) -> Packed<O, P>

Converts to this type from the input type.
source§

impl<S, T, O, P> From<Alpha<Rgb<S, T>, T>> for Packed<O, P>
where O: ComponentOrder<Alpha<Rgb<S, T>, T>, P>,

source§

fn from(color: Alpha<Rgb<S, T>, T>) -> Packed<O, P>

Converts to this type from the input type.
source§

impl<S, T, P, O> From<Luma<S, T>> for Packed<O, P>
where O: ComponentOrder<Alpha<Luma<S, T>, T>, P>, Alpha<Luma<S, T>, T>: From<Luma<S, T>>,

source§

fn from(color: Luma<S, T>) -> Packed<O, P>

Converts to this type from the input type.
source§

impl<O, P> From<P> for Packed<O, P>
where Packed<O, P>: UintCast<Uint = P>,

source§

fn from(uint: P) -> Packed<O, P>

Converts to this type from the input type.
source§

impl<S, T, P, O> From<Rgb<S, T>> for Packed<O, P>
where O: ComponentOrder<Alpha<Rgb<S, T>, T>, P>, Alpha<Rgb<S, T>, T>: From<Rgb<S, T>>,

source§

fn from(color: Rgb<S, T>) -> Packed<O, P>

Converts to this type from the input type.
source§

impl<O, P> PartialEq for Packed<O, P>
where O: PartialEq, P: PartialEq,

source§

fn eq(&self, other: &Packed<O, P>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<O> UintCast for Packed<O, u128>

source§

type Uint = u128

An unsigned integer with the same size as Self.
source§

impl<O> UintCast for Packed<O, u16>

source§

type Uint = u16

An unsigned integer with the same size as Self.
source§

impl<O> UintCast for Packed<O, u32>

source§

type Uint = u32

An unsigned integer with the same size as Self.
source§

impl<O> UintCast for Packed<O, u64>

source§

type Uint = u64

An unsigned integer with the same size as Self.
source§

impl<O> UintCast for Packed<O, u8>

source§

type Uint = u8

An unsigned integer with the same size as Self.
source§

impl<O, P> Copy for Packed<O, P>
where P: Copy,

source§

impl<O, P> Eq for Packed<O, P>
where O: Eq, P: Eq,

source§

impl<O, P> StructuralPartialEq for Packed<O, P>