Struct color::AlphaColor
source · [−]pub struct AlphaColor<T, C> {
pub c: C,
pub a: T,
}
Fields
c: C
a: T
Implementations
sourceimpl<T, C> AlphaColor<T, C>
impl<T, C> AlphaColor<T, C>
pub const fn new(c: C, a: T) -> AlphaColor<T, C>
sourceimpl<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>
sourceimpl<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
sourceimpl<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.
sourcefn add(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
fn add(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
Performs the +
operation. Read more
sourceimpl<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>
sourcefn borrow_mut(&mut self) -> &mut [T; 4]
fn borrow_mut(&mut self) -> &mut [T; 4]
Mutably borrows from an owned value. Read more
sourceimpl<T: Clone, C: Clone> Clone for AlphaColor<T, C>
impl<T: Clone, C: Clone> Clone for AlphaColor<T, C>
sourcefn clone(&self) -> AlphaColor<T, C>
fn clone(&self) -> AlphaColor<T, C>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Channel, C: Color<T>> Color<T> for AlphaColor<T, C>
impl<T: Channel, C: Color<T>> Color<T> for AlphaColor<T, C>
sourcefn 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)
.
sourcefn 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
.
sourcefn inverse(self) -> AlphaColor<T, C>
fn inverse(self) -> AlphaColor<T, C>
Inverts the color.
fn mix(self, other: Self, value: T) -> Self
sourceimpl<T: Debug, C: Debug> Debug for AlphaColor<T, C>
impl<T: Debug, C: Debug> Debug for AlphaColor<T, C>
sourceimpl<'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>,
sourcefn 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
sourceimpl<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.
sourcefn div(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
fn div(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
Performs the /
operation. Read more
sourceimpl<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.
sourcefn div(self, rhs: T) -> AlphaColor<T, C>
fn div(self, rhs: T) -> AlphaColor<T, C>
Performs the /
operation. Read more
sourceimpl<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.
sourcefn mul(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
fn mul(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
Performs the *
operation. Read more
sourceimpl<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.
sourcefn mul(self, rhs: T) -> AlphaColor<T, C>
fn mul(self, rhs: T) -> AlphaColor<T, C>
Performs the *
operation. Read more
sourceimpl<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>
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &AlphaColor<T, C>) -> bool
fn ne(&self, other: &AlphaColor<T, C>) -> bool
This method tests for !=
.
sourceimpl<T: Channel + Saturating, C: Saturating> Saturating for AlphaColor<T, C>
impl<T: Channel + Saturating, C: Saturating> Saturating for AlphaColor<T, C>
sourcefn 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. Read more
sourcefn 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. Read more
sourceimpl<T, C> Serialize for AlphaColor<T, C> where
T: Serialize,
C: Serialize,
impl<T, C> Serialize for AlphaColor<T, C> where
T: Serialize,
C: Serialize,
sourceimpl<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.
sourcefn sub(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
fn sub(self, rhs: AlphaColor<T, C>) -> AlphaColor<T, C>
Performs the -
operation. Read more
sourceimpl<T, C: ToLuma> ToLuma for AlphaColor<T, C>
impl<T, C: ToLuma> ToLuma for AlphaColor<T, C>
sourceimpl<T, C: ToRgb> ToRgb for AlphaColor<T, C>
impl<T, C: ToRgb> ToRgb for AlphaColor<T, C>
sourceimpl<T: Channel, C: ToRgb> ToRgba for AlphaColor<T, C>
impl<T: Channel, C: ToRgb> ToRgba 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more