color

Struct 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 for AlphaColor<T, C>

Source§

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 + Div<T, Output = T>, C: Div<T, Output = C>> Div<T> for AlphaColor<T, C>

Source§

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: Channel, C: Div<Output = C>> Div for AlphaColor<T, C>

Source§

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, C: AsRef<[T; 3]>> Index<usize> for AlphaColor<T, C>

Source§

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 + Mul<T, Output = T>, C: Mul<T, Output = C>> Mul<T> for AlphaColor<T, C>

Source§

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: Channel, C: Mul<Output = C>> Mul for AlphaColor<T, C>

Source§

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

Source§

fn eq(&self, other: &AlphaColor<T, C>) -> 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<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 for AlphaColor<T, C>

Source§

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>

Source§

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>

Source§

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>

Source§

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> StructuralPartialEq for AlphaColor<T, C>

Auto Trait Implementations§

§

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

§

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

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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 T
where T: for<'de> Deserialize<'de>,