Struct color::AlphaColor

source ·
pub struct AlphaColor<T, C> {
    pub c: C,
    pub a: T,
}

Fields§

§c: C§a: T

Implementations§

source§

impl<T, C> AlphaColor<T, C>

source

pub const fn new(c: C, a: T) -> AlphaColor<T, C>

source§

impl<T: Channel, S: TransferFunction> AlphaColor<T, Rgb<T, S>>

source

pub fn from_hex(hex: u32) -> Rgba<T, S>

source

pub fn rg(&self) -> Rg<T, S>

source

pub fn rb(&self) -> Rg<T, S>

source

pub fn gr(&self) -> Rg<T, S>

source

pub fn gb(&self) -> Rg<T, S>

source

pub fn br(&self) -> Rg<T, S>

source

pub fn bg(&self) -> Rg<T, S>

source

pub fn ar(&self) -> Rg<T, S>

source

pub fn ag(&self) -> Rg<T, S>

source

pub fn ab(&self) -> Rg<T, S>

source

pub fn ra(&self) -> Rg<T, S>

source

pub fn ga(&self) -> Rg<T, S>

source

pub fn ba(&self) -> Rg<T, S>

source

pub fn rgb(&self) -> Rgb<T, S>

source

pub fn rbg(&self) -> Rgb<T, S>

source

pub fn bgr(&self) -> Rgb<T, S>

source

pub fn brg(&self) -> Rgb<T, S>

source

pub fn grb(&self) -> Rgb<T, S>

source

pub fn gbr(&self) -> Rgb<T, S>

source

pub fn rga(&self) -> Rgb<T, S>

source

pub fn rba(&self) -> Rgb<T, S>

source

pub fn bra(&self) -> Rgb<T, S>

source

pub fn bga(&self) -> Rgb<T, S>

source

pub fn gra(&self) -> Rgb<T, S>

source

pub fn gba(&self) -> Rgb<T, S>

source

pub fn arg(&self) -> Rgb<T, S>

source

pub fn arb(&self) -> Rgb<T, S>

source

pub fn agr(&self) -> Rgb<T, S>

source

pub fn agb(&self) -> Rgb<T, S>

source

pub fn abr(&self) -> Rgb<T, S>

source

pub fn abg(&self) -> Rgb<T, S>

source

pub fn rag(&self) -> Rgb<T, S>

source

pub fn rab(&self) -> Rgb<T, S>

source

pub fn gar(&self) -> Rgb<T, S>

source

pub fn gab(&self) -> Rgb<T, S>

source

pub fn bar(&self) -> Rgb<T, S>

source

pub fn bag(&self) -> Rgb<T, S>

source

pub fn rgba(&self) -> Rgba<T, S>

source

pub fn rbga(&self) -> Rgba<T, S>

source

pub fn grba(&self) -> Rgba<T, S>

source

pub fn gbra(&self) -> Rgba<T, S>

source

pub fn brga(&self) -> Rgba<T, S>

source

pub fn bgra(&self) -> Rgba<T, S>

source

pub fn argb(&self) -> Rgba<T, S>

source

pub fn arbg(&self) -> Rgba<T, S>

source

pub fn agrb(&self) -> Rgba<T, S>

source

pub fn agbr(&self) -> Rgba<T, S>

source

pub fn abrg(&self) -> Rgba<T, S>

source

pub fn abgr(&self) -> Rgba<T, S>

source

pub fn ragb(&self) -> Rgba<T, S>

source

pub fn rabg(&self) -> Rgba<T, S>

source

pub fn garb(&self) -> Rgba<T, S>

source

pub fn gabr(&self) -> Rgba<T, S>

source

pub fn barg(&self) -> Rgba<T, S>

source

pub fn bagr(&self) -> Rgba<T, S>

source

pub fn rgab(&self) -> Rgba<T, S>

source

pub fn rbag(&self) -> Rgba<T, S>

source

pub fn grab(&self) -> Rgba<T, S>

source

pub fn gbar(&self) -> Rgba<T, S>

source

pub fn brag(&self) -> Rgba<T, S>

source

pub fn bgar(&self) -> Rgba<T, S>

source§

impl<T: Channel, S: TransferFunction> AlphaColor<T, Rgb<T, S>>

source

pub fn to_standard<S2: TransferFunction>(&self) -> Rgba<T, S2>

source

pub fn to_linear(&self) -> Rgba<T, LinearRgb>

Trait Implementations§

source§

impl<T: Channel + Add<T, Output = T>, C: Add<Output = C>> Add<AlphaColor<T, C>> for AlphaColor<T, C>

§

type Output = AlphaColor<T, C>

The resulting type after applying the + operator.
source§

fn add(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>

Performs the + operation. Read more
source§

impl<T, C: AsMut<[T; 3]>> AsMut<[T; 4]> for AlphaColor<T, C>

source§

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

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

impl<T, C: AsRef<[T; 3]>> AsRef<[T; 4]> for AlphaColor<T, C>

source§

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

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

impl<T, C: Borrow<[T; 3]>> Borrow<[T; 4]> for AlphaColor<T, C>

source§

fn borrow(&self) -> &[T; 4]

Immutably borrows from an owned value. Read more
source§

impl<T, C: BorrowMut<[T; 3]>> BorrowMut<[T; 4]> for AlphaColor<T, C>

source§

fn borrow_mut(&mut self) -> &mut [T; 4]

Mutably borrows from an owned value. Read more
source§

impl<T: Clone, C: Clone> Clone for AlphaColor<T, C>

source§

fn clone(&self) -> AlphaColor<T, C>

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<T: Channel, C: Color<T>> Color<T> for AlphaColor<T, C>

source§

fn clamp_s(self, lo: T, hi: T) -> AlphaColor<T, C>

Clamps the components of the color to the range (lo,hi).

source§

fn clamp_c(self, lo: AlphaColor<T, C>, hi: AlphaColor<T, C>) -> AlphaColor<T, C>

Clamps the components of the color component-wise between lo and hi.

source§

fn inverse(self) -> AlphaColor<T, C>

Inverts the color.

source§

fn mix(self, other: Self, value: T) -> Self

source§

impl<T: Debug, C: Debug> Debug for AlphaColor<T, C>

source§

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

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

impl<'de, T, C> Deserialize<'de> for AlphaColor<T, C>where T: Deserialize<'de>, C: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T: Channel, C: Div<Output = C>> Div<AlphaColor<T, C>> for AlphaColor<T, C>

§

type Output = AlphaColor<T, C>

The resulting type after applying the / operator.
source§

fn div(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>

Performs the / operation. Read more
source§

impl<T: Channel + Div<T, Output = T>, C: Div<T, Output = C>> Div<T> for AlphaColor<T, C>

§

type Output = AlphaColor<T, C>

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> AlphaColor<T, C>

Performs the / operation. Read more
source§

impl<T, C: AsRef<[T; 3]>> Index<usize> for AlphaColor<T, C>

§

type Output = T

The returned type after indexing.
source§

fn index<'a>(&'a self, index: usize) -> &'a T

Performs the indexing (container[index]) operation. Read more
source§

impl<T, C: AsRef<[T; 3]> + AsMut<[T; 3]>> IndexMut<usize> for AlphaColor<T, C>

source§

fn index_mut<'a>(&'a mut self, index: usize) -> &'a mut T

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<T: Channel, C: Mul<Output = C>> Mul<AlphaColor<T, C>> for AlphaColor<T, C>

§

type Output = AlphaColor<T, C>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>

Performs the * operation. Read more
source§

impl<T: Channel + Mul<T, Output = T>, C: Mul<T, Output = C>> Mul<T> for AlphaColor<T, C>

§

type Output = AlphaColor<T, C>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> AlphaColor<T, C>

Performs the * operation. Read more
source§

impl<T: PartialEq, C: PartialEq> PartialEq<AlphaColor<T, C>> for AlphaColor<T, C>

source§

fn eq(&self, other: &AlphaColor<T, C>) -> bool

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

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

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

impl<T: Channel + Saturating, C: Saturating> Saturating for AlphaColor<T, C>

source§

fn saturating_add(self, v: AlphaColor<T, C>) -> AlphaColor<T, C>

Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.
source§

fn saturating_sub(self, v: AlphaColor<T, C>) -> AlphaColor<T, C>

Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.
source§

impl<T, C> Serialize for AlphaColor<T, C>where T: Serialize, C: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T: Channel + Sub<T, Output = T>, C: Sub<Output = C>> Sub<AlphaColor<T, C>> for AlphaColor<T, C>

§

type Output = AlphaColor<T, C>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>

Performs the - operation. Read more
source§

impl<T, C: ToLuma> ToLuma for AlphaColor<T, C>

§

type Standard = <C as ToLuma>::Standard

source§

fn to_luma<U: Channel>(&self) -> Luma<U, Self::Standard>

source§

impl<T, C: ToRgb> ToRgb for AlphaColor<T, C>

§

type Standard = <C as ToRgb>::Standard

source§

fn to_rgb<U: Channel>(&self) -> Rgb<U, Self::Standard>

source§

impl<T: Channel, C: ToRgb> ToRgba for AlphaColor<T, C>

§

type Standard = <C as ToRgb>::Standard

source§

fn to_rgba<U: Channel>(&self) -> Rgba<U, Self::Standard>

source§

impl<T: Copy, C: Copy> Copy for AlphaColor<T, C>

source§

impl<T: Eq, C: Eq> Eq for AlphaColor<T, C>

source§

impl<T, C> StructuralEq for AlphaColor<T, C>

source§

impl<T, C> StructuralPartialEq for AlphaColor<T, C>

Auto Trait Implementations§

§

impl<T, C> RefUnwindSafe for AlphaColor<T, C>where C: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, C> Send for AlphaColor<T, C>where C: Send, T: Send,

§

impl<T, C> Sync for AlphaColor<T, C>where C: Sync, T: Sync,

§

impl<T, C> Unpin for AlphaColor<T, C>where C: Unpin, T: Unpin,

§

impl<T, C> UnwindSafe for AlphaColor<T, C>where C: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,