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>
impl<T, C> AlphaColor<T, C>
pub const fn new(c: C, a: T) -> AlphaColor<T, C>
source§impl<T: Channel, S: TransferFunction> AlphaColor<T, Rgb<T, S>>
impl<T: Channel, S: TransferFunction> AlphaColor<T, Rgb<T, S>>
pub fn from_hex(hex: u32) -> Rgba<T, S>
pub fn rg(&self) -> Rg<T, S>
pub fn rb(&self) -> Rg<T, S>
pub fn gr(&self) -> Rg<T, S>
pub fn gb(&self) -> Rg<T, S>
pub fn br(&self) -> Rg<T, S>
pub fn bg(&self) -> Rg<T, S>
pub fn ar(&self) -> Rg<T, S>
pub fn ag(&self) -> Rg<T, S>
pub fn ab(&self) -> Rg<T, S>
pub fn ra(&self) -> Rg<T, S>
pub fn ga(&self) -> Rg<T, S>
pub fn ba(&self) -> Rg<T, S>
pub fn rgb(&self) -> Rgb<T, S>
pub fn rbg(&self) -> Rgb<T, S>
pub fn bgr(&self) -> Rgb<T, S>
pub fn brg(&self) -> Rgb<T, S>
pub fn grb(&self) -> Rgb<T, S>
pub fn gbr(&self) -> Rgb<T, S>
pub fn rga(&self) -> Rgb<T, S>
pub fn rba(&self) -> Rgb<T, S>
pub fn bra(&self) -> Rgb<T, S>
pub fn bga(&self) -> Rgb<T, S>
pub fn gra(&self) -> Rgb<T, S>
pub fn gba(&self) -> Rgb<T, S>
pub fn arg(&self) -> Rgb<T, S>
pub fn arb(&self) -> Rgb<T, S>
pub fn agr(&self) -> Rgb<T, S>
pub fn agb(&self) -> Rgb<T, S>
pub fn abr(&self) -> Rgb<T, S>
pub fn abg(&self) -> Rgb<T, S>
pub fn rag(&self) -> Rgb<T, S>
pub fn rab(&self) -> Rgb<T, S>
pub fn gar(&self) -> Rgb<T, S>
pub fn gab(&self) -> Rgb<T, S>
pub fn bar(&self) -> Rgb<T, S>
pub fn bag(&self) -> Rgb<T, S>
pub fn rgba(&self) -> Rgba<T, S>
pub fn rbga(&self) -> Rgba<T, S>
pub fn grba(&self) -> Rgba<T, S>
pub fn gbra(&self) -> Rgba<T, S>
pub fn brga(&self) -> Rgba<T, S>
pub fn bgra(&self) -> Rgba<T, S>
pub fn argb(&self) -> Rgba<T, S>
pub fn arbg(&self) -> Rgba<T, S>
pub fn agrb(&self) -> Rgba<T, S>
pub fn agbr(&self) -> Rgba<T, S>
pub fn abrg(&self) -> Rgba<T, S>
pub fn abgr(&self) -> Rgba<T, S>
pub fn ragb(&self) -> Rgba<T, S>
pub fn rabg(&self) -> Rgba<T, S>
pub fn garb(&self) -> Rgba<T, S>
pub fn gabr(&self) -> Rgba<T, S>
pub fn barg(&self) -> Rgba<T, S>
pub fn bagr(&self) -> Rgba<T, S>
pub fn rgab(&self) -> Rgba<T, S>
pub fn rbag(&self) -> Rgba<T, S>
pub fn grab(&self) -> Rgba<T, S>
pub fn gbar(&self) -> Rgba<T, S>
pub fn brag(&self) -> Rgba<T, S>
pub fn bgar(&self) -> Rgba<T, S>
source§impl<T: Channel, S: TransferFunction> AlphaColor<T, Rgb<T, S>>
impl<T: Channel, S: TransferFunction> AlphaColor<T, Rgb<T, S>>
pub fn to_standard<S2: TransferFunction>(&self) -> Rgba<T, S2>
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>
impl<T: Channel + Add<T, Output = T>, C: Add<Output = C>> Add<AlphaColor<T, C>> for AlphaColor<T, C>
§type Output = 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>
fn add(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
Performs the
+
operation. Read moresource§impl<T, C: BorrowMut<[T; 3]>> BorrowMut<[T; 4]> for AlphaColor<T, C>
impl<T, C: BorrowMut<[T; 3]>> BorrowMut<[T; 4]> for AlphaColor<T, C>
source§fn borrow_mut(&mut self) -> &mut [T; 4]
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>
impl<T: Clone, C: Clone> Clone for AlphaColor<T, C>
source§fn clone(&self) -> AlphaColor<T, C>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Channel, C: Color<T>> Color<T> for AlphaColor<T, C>
impl<T: Channel, C: Color<T>> Color<T> for AlphaColor<T, C>
source§fn clamp_s(self, lo: T, hi: T) -> AlphaColor<T, C>
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>
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>
fn inverse(self) -> AlphaColor<T, C>
Inverts the color.
fn mix(self, other: Self, value: T) -> Self
source§impl<'de, T, C> Deserialize<'de> for AlphaColor<T, C>where
T: Deserialize<'de>,
C: Deserialize<'de>,
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>,
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>
impl<T: Channel, C: Div<Output = C>> Div<AlphaColor<T, C>> for AlphaColor<T, C>
§type Output = 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>
fn div(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
Performs the
/
operation. Read moresource§impl<T: Channel + Div<T, Output = T>, C: Div<T, Output = C>> Div<T> for AlphaColor<T, C>
impl<T: Channel + Div<T, Output = T>, C: Div<T, Output = C>> Div<T> for AlphaColor<T, C>
§type Output = AlphaColor<T, C>
type Output = AlphaColor<T, C>
The resulting type after applying the
/
operator.source§fn div(self, rhs: T) -> AlphaColor<T, C>
fn div(self, rhs: T) -> AlphaColor<T, C>
Performs the
/
operation. Read moresource§impl<T: Channel, C: Mul<Output = C>> Mul<AlphaColor<T, C>> for AlphaColor<T, C>
impl<T: Channel, C: Mul<Output = C>> Mul<AlphaColor<T, C>> for AlphaColor<T, C>
§type Output = 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>
fn mul(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
Performs the
*
operation. Read moresource§impl<T: Channel + Mul<T, Output = T>, C: Mul<T, Output = C>> Mul<T> for AlphaColor<T, C>
impl<T: Channel + Mul<T, Output = T>, C: Mul<T, Output = C>> Mul<T> for AlphaColor<T, C>
§type Output = AlphaColor<T, C>
type Output = AlphaColor<T, C>
The resulting type after applying the
*
operator.source§fn mul(self, rhs: T) -> AlphaColor<T, C>
fn mul(self, rhs: T) -> AlphaColor<T, C>
Performs the
*
operation. Read moresource§impl<T: PartialEq, C: PartialEq> PartialEq<AlphaColor<T, C>> for AlphaColor<T, C>
impl<T: PartialEq, C: PartialEq> PartialEq<AlphaColor<T, C>> for AlphaColor<T, C>
source§fn eq(&self, other: &AlphaColor<T, C>) -> bool
fn eq(&self, other: &AlphaColor<T, C>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: Channel + Saturating, C: Saturating> Saturating for AlphaColor<T, C>
impl<T: Channel + Saturating, C: Saturating> Saturating for AlphaColor<T, C>
source§fn saturating_add(self, v: AlphaColor<T, C>) -> AlphaColor<T, C>
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>
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: Channel + Sub<T, Output = T>, C: Sub<Output = C>> Sub<AlphaColor<T, C>> for AlphaColor<T, C>
impl<T: Channel + Sub<T, Output = T>, C: Sub<Output = C>> Sub<AlphaColor<T, C>> for AlphaColor<T, C>
§type Output = 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>
fn sub(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
Performs the
-
operation. Read moresource§impl<T, C: ToLuma> ToLuma for AlphaColor<T, C>
impl<T, C: ToLuma> ToLuma for AlphaColor<T, C>
source§impl<T, C: ToRgb> ToRgb for AlphaColor<T, C>
impl<T, C: ToRgb> ToRgb for AlphaColor<T, C>
impl<T: Copy, C: Copy> Copy for AlphaColor<T, C>
impl<T: Eq, C: Eq> Eq for AlphaColor<T, C>
impl<T, C> StructuralEq for AlphaColor<T, C>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more