#[repr(C)]pub struct Alpha<C, T> {
pub color: C,
pub alpha: T,
}
Expand description
An alpha component wrapper for colors.
Fields§
§color: C
The color.
alpha: T
The transparency component. 0.0 is fully transparent and 1.0 is fully opaque.
Implementations§
source§impl<C, A> Alpha<C, A>
impl<C, A> Alpha<C, A>
sourcepub fn iter<'a>(&'a self) -> <&'a Self as IntoIterator>::IntoIterwhere
&'a Self: IntoIterator,
pub fn iter<'a>(&'a self) -> <&'a Self as IntoIterator>::IntoIterwhere &'a Self: IntoIterator,
Return an iterator over the colors in the wrapped collections.
sourcepub fn iter_mut<'a>(&'a mut self) -> <&'a mut Self as IntoIterator>::IntoIterwhere
&'a mut Self: IntoIterator,
pub fn iter_mut<'a>(&'a mut self) -> <&'a mut Self as IntoIterator>::IntoIterwhere &'a mut Self: IntoIterator,
Return an iterator that allows modifying the colors in the wrapped collections.
source§impl<C: Premultiply> Alpha<C, C::Scalar>
impl<C: Premultiply> Alpha<C, C::Scalar>
sourcepub fn premultiply(self) -> PreAlpha<C>
pub fn premultiply(self) -> PreAlpha<C>
Alpha mask the color by its transparency.
source§impl<T, A> Alpha<Hsl<Srgb, T>, A>
impl<T, A> Alpha<Hsl<Srgb, T>, A>
Hsla
implementations.
sourcepub fn new_srgb<H: Into<RgbHue<T>>>(
hue: H,
saturation: T,
lightness: T,
alpha: A
) -> Self
pub fn new_srgb<H: Into<RgbHue<T>>>( hue: H, saturation: T, lightness: T, alpha: A ) -> Self
Create an sRGB HSL color with transparency. This method can be used
instead of Hsla::new
to help type inference.
sourcepub const fn new_srgb_const(
hue: RgbHue<T>,
saturation: T,
lightness: T,
alpha: A
) -> Self
pub const fn new_srgb_const( hue: RgbHue<T>, saturation: T, lightness: T, alpha: A ) -> Self
Create an sRGB HSL color with transparency. This is the same as
Hsla::new_srgb
without the generic hue type. It’s temporary until
const fn
supports traits.
source§impl<S, T, A> Alpha<Hsl<S, T>, A>
impl<S, T, A> Alpha<Hsl<S, T>, A>
Hsla
implementations.
sourcepub fn new<H: Into<RgbHue<T>>>(
hue: H,
saturation: T,
lightness: T,
alpha: A
) -> Self
pub fn new<H: Into<RgbHue<T>>>( hue: H, saturation: T, lightness: T, alpha: A ) -> Self
Create an HSL color with transparency.
sourcepub const fn new_const(
hue: RgbHue<T>,
saturation: T,
lightness: T,
alpha: A
) -> Self
pub const fn new_const( hue: RgbHue<T>, saturation: T, lightness: T, alpha: A ) -> Self
Create an HSL color with transparency. This is the same as Hsla::new
without the generic hue type. It’s temporary until const fn
supports
traits.
sourcepub fn into_format<U, B>(self) -> Alpha<Hsl<S, U>, B>where
U: FromStimulus<T> + FromAngle<T>,
B: FromStimulus<A>,
pub fn into_format<U, B>(self) -> Alpha<Hsl<S, U>, B>where U: FromStimulus<T> + FromAngle<T>, B: FromStimulus<A>,
Convert into another component type.
sourcepub fn from_format<U, B>(color: Alpha<Hsl<S, U>, B>) -> Selfwhere
T: FromStimulus<U> + FromAngle<U>,
A: FromStimulus<B>,
pub fn from_format<U, B>(color: Alpha<Hsl<S, U>, B>) -> Selfwhere T: FromStimulus<U> + FromAngle<U>, A: FromStimulus<B>,
Convert from another component type.
sourcepub fn into_components(self) -> (RgbHue<T>, T, T, A)
pub fn into_components(self) -> (RgbHue<T>, T, T, A)
Convert to a (hue, saturation, lightness, alpha)
tuple.
sourcepub fn from_components<H: Into<RgbHue<T>>>(
(hue, saturation, lightness, alpha): (H, T, T, A)
) -> Self
pub fn from_components<H: Into<RgbHue<T>>>( (hue, saturation, lightness, alpha): (H, T, T, A) ) -> Self
Convert from a (hue, saturation, lightness, alpha)
tuple.
source§impl<S, T, A> Alpha<Hsl<S, &mut T>, &mut A>
impl<S, T, A> Alpha<Hsl<S, &mut T>, &mut A>
source§impl<S, Ct, Ca> Alpha<Hsl<S, Ct>, Ca>
impl<S, Ct, Ca> Alpha<Hsl<S, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Hsl<S, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Hsl<S, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Hsl<S, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Hsl<S, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<S, T, A> Alpha<Hsl<S, Vec<T>>, Vec<A>>
impl<S, T, A> Alpha<Hsl<S, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Hsl<S, T>, A>)
pub fn push(&mut self, value: Alpha<Hsl<S, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Hsl<S, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Hsl<S, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<Wp, T, A> Alpha<Hsluv<Wp, T>, A>
impl<Wp, T, A> Alpha<Hsluv<Wp, T>, A>
Hsluva
implementations.
sourcepub fn new<H: Into<LuvHue<T>>>(hue: H, saturation: T, l: T, alpha: A) -> Self
pub fn new<H: Into<LuvHue<T>>>(hue: H, saturation: T, l: T, alpha: A) -> Self
Create an HSLuv color with transparency.
sourcepub const fn new_const(hue: LuvHue<T>, saturation: T, l: T, alpha: A) -> Self
pub const fn new_const(hue: LuvHue<T>, saturation: T, l: T, alpha: A) -> Self
Create an HSLuv color with transparency. This is the same as
Hsluva::new
without the generic hue type. It’s temporary until const fn
supports traits.
sourcepub fn into_components(self) -> (LuvHue<T>, T, T, A)
pub fn into_components(self) -> (LuvHue<T>, T, T, A)
Convert to a (hue, saturation, l, alpha)
tuple.
sourcepub fn from_components<H: Into<LuvHue<T>>>(
(hue, saturation, l, alpha): (H, T, T, A)
) -> Self
pub fn from_components<H: Into<LuvHue<T>>>( (hue, saturation, l, alpha): (H, T, T, A) ) -> Self
Convert from a (hue, saturation, l, alpha)
tuple.
source§impl<Wp, T, A> Alpha<Hsluv<Wp, &mut T>, &mut A>
impl<Wp, T, A> Alpha<Hsluv<Wp, &mut T>, &mut A>
source§impl<Wp, Ct, Ca> Alpha<Hsluv<Wp, Ct>, Ca>
impl<Wp, Ct, Ca> Alpha<Hsluv<Wp, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Hsluv<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Hsluv<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Hsluv<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Hsluv<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<Wp, T, A> Alpha<Hsluv<Wp, Vec<T>>, Vec<A>>
impl<Wp, T, A> Alpha<Hsluv<Wp, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Hsluv<Wp, T>, A>)
pub fn push(&mut self, value: Alpha<Hsluv<Wp, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Hsluv<Wp, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Hsluv<Wp, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<T, A> Alpha<Hsv<Srgb, T>, A>
impl<T, A> Alpha<Hsv<Srgb, T>, A>
Hsva
implementations.
sourcepub fn new_srgb<H: Into<RgbHue<T>>>(
hue: H,
saturation: T,
value: T,
alpha: A
) -> Self
pub fn new_srgb<H: Into<RgbHue<T>>>( hue: H, saturation: T, value: T, alpha: A ) -> Self
Create an sRGB HSV color with transparency. This method can be used
instead of Hsva::new
to help type inference.
sourcepub const fn new_srgb_const(
hue: RgbHue<T>,
saturation: T,
value: T,
alpha: A
) -> Self
pub const fn new_srgb_const( hue: RgbHue<T>, saturation: T, value: T, alpha: A ) -> Self
Create an sRGB HSV color with transparency. This is the same as
Hsva::new_srgb
without the generic hue type. It’s temporary until
const fn
supports traits.
source§impl<S, T, A> Alpha<Hsv<S, T>, A>
impl<S, T, A> Alpha<Hsv<S, T>, A>
Hsva
implementations.
sourcepub fn new<H: Into<RgbHue<T>>>(
hue: H,
saturation: T,
value: T,
alpha: A
) -> Self
pub fn new<H: Into<RgbHue<T>>>( hue: H, saturation: T, value: T, alpha: A ) -> Self
Create an HSV color with transparency.
sourcepub const fn new_const(
hue: RgbHue<T>,
saturation: T,
value: T,
alpha: A
) -> Self
pub const fn new_const( hue: RgbHue<T>, saturation: T, value: T, alpha: A ) -> Self
Create an HSV color with transparency. This is the same as Hsva::new
without the generic hue type. It’s temporary until const fn
supports
traits.
sourcepub fn into_format<U, B>(self) -> Alpha<Hsv<S, U>, B>where
U: FromStimulus<T> + FromAngle<T>,
B: FromStimulus<A>,
pub fn into_format<U, B>(self) -> Alpha<Hsv<S, U>, B>where U: FromStimulus<T> + FromAngle<T>, B: FromStimulus<A>,
Convert into another component type.
sourcepub fn from_format<U, B>(color: Alpha<Hsv<S, U>, B>) -> Selfwhere
T: FromStimulus<U> + FromAngle<U>,
A: FromStimulus<B>,
pub fn from_format<U, B>(color: Alpha<Hsv<S, U>, B>) -> Selfwhere T: FromStimulus<U> + FromAngle<U>, A: FromStimulus<B>,
Convert from another component type.
sourcepub fn into_components(self) -> (RgbHue<T>, T, T, A)
pub fn into_components(self) -> (RgbHue<T>, T, T, A)
Convert to a (hue, saturation, value, alpha)
tuple.
sourcepub fn from_components<H: Into<RgbHue<T>>>(
(hue, saturation, value, alpha): (H, T, T, A)
) -> Self
pub fn from_components<H: Into<RgbHue<T>>>( (hue, saturation, value, alpha): (H, T, T, A) ) -> Self
Convert from a (hue, saturation, value, alpha)
tuple.
source§impl<S, T, A> Alpha<Hsv<S, &mut T>, &mut A>
impl<S, T, A> Alpha<Hsv<S, &mut T>, &mut A>
source§impl<S, Ct, Ca> Alpha<Hsv<S, Ct>, Ca>
impl<S, Ct, Ca> Alpha<Hsv<S, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Hsv<S, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Hsv<S, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Hsv<S, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Hsv<S, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<S, T, A> Alpha<Hsv<S, Vec<T>>, Vec<A>>
impl<S, T, A> Alpha<Hsv<S, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Hsv<S, T>, A>)
pub fn push(&mut self, value: Alpha<Hsv<S, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Hsv<S, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Hsv<S, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<T, A> Alpha<Hwb<Srgb, T>, A>
impl<T, A> Alpha<Hwb<Srgb, T>, A>
Hwba
implementations.
sourcepub fn new_srgb<H: Into<RgbHue<T>>>(
hue: H,
whiteness: T,
blackness: T,
alpha: A
) -> Self
pub fn new_srgb<H: Into<RgbHue<T>>>( hue: H, whiteness: T, blackness: T, alpha: A ) -> Self
Create an sRGB HWB color with transparency. This method can be used
instead of Hwba::new
to help type inference.
sourcepub const fn new_srgb_const(
hue: RgbHue<T>,
whiteness: T,
blackness: T,
alpha: A
) -> Self
pub const fn new_srgb_const( hue: RgbHue<T>, whiteness: T, blackness: T, alpha: A ) -> Self
Create an sRGB HWB color with transparency. This is the same as
Hwba::new_srgb
without the generic hue type. It’s temporary until const fn
supports traits.
source§impl<S, T, A> Alpha<Hwb<S, T>, A>
impl<S, T, A> Alpha<Hwb<S, T>, A>
Hwba
implementations.
sourcepub fn new<H: Into<RgbHue<T>>>(
hue: H,
whiteness: T,
blackness: T,
alpha: A
) -> Self
pub fn new<H: Into<RgbHue<T>>>( hue: H, whiteness: T, blackness: T, alpha: A ) -> Self
Create an HWB color with transparency.
sourcepub const fn new_const(
hue: RgbHue<T>,
whiteness: T,
blackness: T,
alpha: A
) -> Self
pub const fn new_const( hue: RgbHue<T>, whiteness: T, blackness: T, alpha: A ) -> Self
Create an HWB color with transparency. This is the same as Hwba::new
without the
generic hue type. It’s temporary until const fn
supports traits.
sourcepub fn into_format<U, B>(self) -> Alpha<Hwb<S, U>, B>where
U: FromStimulus<T> + FromAngle<T>,
B: FromStimulus<A>,
pub fn into_format<U, B>(self) -> Alpha<Hwb<S, U>, B>where U: FromStimulus<T> + FromAngle<T>, B: FromStimulus<A>,
Convert into another component type.
sourcepub fn from_format<U, B>(color: Alpha<Hwb<S, U>, B>) -> Selfwhere
T: FromStimulus<U> + FromAngle<U>,
A: FromStimulus<B>,
pub fn from_format<U, B>(color: Alpha<Hwb<S, U>, B>) -> Selfwhere T: FromStimulus<U> + FromAngle<U>, A: FromStimulus<B>,
Convert from another component type.
sourcepub fn into_components(self) -> (RgbHue<T>, T, T, A)
pub fn into_components(self) -> (RgbHue<T>, T, T, A)
Convert to a (hue, whiteness, blackness, alpha)
tuple.
sourcepub fn from_components<H: Into<RgbHue<T>>>(
(hue, whiteness, blackness, alpha): (H, T, T, A)
) -> Self
pub fn from_components<H: Into<RgbHue<T>>>( (hue, whiteness, blackness, alpha): (H, T, T, A) ) -> Self
Convert from a (hue, whiteness, blackness, alpha)
tuple.
source§impl<S, T, A> Alpha<Hwb<S, &mut T>, &mut A>
impl<S, T, A> Alpha<Hwb<S, &mut T>, &mut A>
source§impl<S, Ct, Ca> Alpha<Hwb<S, Ct>, Ca>
impl<S, Ct, Ca> Alpha<Hwb<S, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Hwb<S, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Hwb<S, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Hwb<S, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Hwb<S, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<S, T, A> Alpha<Hwb<S, Vec<T>>, Vec<A>>
impl<S, T, A> Alpha<Hwb<S, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Hwb<S, T>, A>)
pub fn push(&mut self, value: Alpha<Hwb<S, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Hwb<S, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Hwb<S, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<Wp, T, A> Alpha<Lab<Wp, T>, A>
impl<Wp, T, A> Alpha<Lab<Wp, T>, A>
Laba
implementations.
sourcepub fn into_components(self) -> (T, T, T, A)
pub fn into_components(self) -> (T, T, T, A)
Convert to a (L\*, a\*, b\*, alpha)
tuple.
sourcepub fn from_components((l, a, b, alpha): (T, T, T, A)) -> Self
pub fn from_components((l, a, b, alpha): (T, T, T, A)) -> Self
Convert from a (L\*, a\*, b\*, alpha)
tuple.
source§impl<Wp, T, A> Alpha<Lab<Wp, &mut T>, &mut A>
impl<Wp, T, A> Alpha<Lab<Wp, &mut T>, &mut A>
source§impl<Wp, Ct, Ca> Alpha<Lab<Wp, Ct>, Ca>
impl<Wp, Ct, Ca> Alpha<Lab<Wp, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Lab<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Lab<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Lab<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Lab<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<Wp, T, A> Alpha<Lab<Wp, Vec<T>>, Vec<A>>
impl<Wp, T, A> Alpha<Lab<Wp, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Lab<Wp, T>, A>)
pub fn push(&mut self, value: Alpha<Lab<Wp, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Lab<Wp, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Lab<Wp, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<Wp, T, A> Alpha<Lch<Wp, T>, A>
impl<Wp, T, A> Alpha<Lch<Wp, T>, A>
Lcha
implementations.
sourcepub fn new<H: Into<LabHue<T>>>(l: T, chroma: T, hue: H, alpha: A) -> Self
pub fn new<H: Into<LabHue<T>>>(l: T, chroma: T, hue: H, alpha: A) -> Self
Create a CIE L*C*h° color with transparency.
sourcepub const fn new_const(l: T, chroma: T, hue: LabHue<T>, alpha: A) -> Self
pub const fn new_const(l: T, chroma: T, hue: LabHue<T>, alpha: A) -> Self
Create a CIE L*C*h° color with transparency. This is the same as
Lcha::new
without the generic hue type. It’s temporary until const fn
supports traits.
sourcepub fn into_components(self) -> (T, T, LabHue<T>, A)
pub fn into_components(self) -> (T, T, LabHue<T>, A)
Convert to a (L\*, C\*, h°, alpha)
tuple.
sourcepub fn from_components<H: Into<LabHue<T>>>(
(l, chroma, hue, alpha): (T, T, H, A)
) -> Self
pub fn from_components<H: Into<LabHue<T>>>( (l, chroma, hue, alpha): (T, T, H, A) ) -> Self
Convert from a (L\*, C\*, h°, alpha)
tuple.
source§impl<Wp, T, A> Alpha<Lch<Wp, &mut T>, &mut A>
impl<Wp, T, A> Alpha<Lch<Wp, &mut T>, &mut A>
source§impl<Wp, Ct, Ca> Alpha<Lch<Wp, Ct>, Ca>
impl<Wp, Ct, Ca> Alpha<Lch<Wp, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Lch<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Lch<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Lch<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Lch<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<Wp, T, A> Alpha<Lch<Wp, Vec<T>>, Vec<A>>
impl<Wp, T, A> Alpha<Lch<Wp, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Lch<Wp, T>, A>)
pub fn push(&mut self, value: Alpha<Lch<Wp, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Lch<Wp, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Lch<Wp, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<Wp, T, A> Alpha<Lchuv<Wp, T>, A>
impl<Wp, T, A> Alpha<Lchuv<Wp, T>, A>
Lchuva
implementations.
sourcepub fn new<H: Into<LuvHue<T>>>(l: T, chroma: T, hue: H, alpha: A) -> Self
pub fn new<H: Into<LuvHue<T>>>(l: T, chroma: T, hue: H, alpha: A) -> Self
Create a CIE L*C*uv h°uv color with transparency.
sourcepub const fn new_const(l: T, chroma: T, hue: LuvHue<T>, alpha: A) -> Self
pub const fn new_const(l: T, chroma: T, hue: LuvHue<T>, alpha: A) -> Self
Create a CIE L*C*uv h°uv color with transparency. This is the same as
Lchuva::new
without the generic hue type. It’s temporary until const fn
supports traits.
sourcepub fn into_components(self) -> (T, T, LuvHue<T>, A)
pub fn into_components(self) -> (T, T, LuvHue<T>, A)
Convert to a (L\*, C\*uv, h°uv, alpha)
tuple.
sourcepub fn from_components<H: Into<LuvHue<T>>>(
(l, chroma, hue, alpha): (T, T, H, A)
) -> Self
pub fn from_components<H: Into<LuvHue<T>>>( (l, chroma, hue, alpha): (T, T, H, A) ) -> Self
Convert from a (L\*, C\*uv, h°uv, alpha)
tuple.
source§impl<Wp, T, A> Alpha<Lchuv<Wp, &mut T>, &mut A>
impl<Wp, T, A> Alpha<Lchuv<Wp, &mut T>, &mut A>
source§impl<Wp, Ct, Ca> Alpha<Lchuv<Wp, Ct>, Ca>
impl<Wp, Ct, Ca> Alpha<Lchuv<Wp, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Lchuv<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Lchuv<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Lchuv<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Lchuv<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<Wp, T, A> Alpha<Lchuv<Wp, Vec<T>>, Vec<A>>
impl<Wp, T, A> Alpha<Lchuv<Wp, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Lchuv<Wp, T>, A>)
pub fn push(&mut self, value: Alpha<Lchuv<Wp, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Lchuv<Wp, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Lchuv<Wp, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<S, T, A> Alpha<Luma<S, T>, A>
impl<S, T, A> Alpha<Luma<S, T>, A>
Lumaa
implementations.
sourcepub fn into_format<U, B>(self) -> Alpha<Luma<S, U>, B>where
U: FromStimulus<T>,
B: FromStimulus<A>,
pub fn into_format<U, B>(self) -> Alpha<Luma<S, U>, B>where U: FromStimulus<T>, B: FromStimulus<A>,
Convert into another component type.
sourcepub fn from_format<U, B>(color: Alpha<Luma<S, U>, B>) -> Selfwhere
T: FromStimulus<U>,
A: FromStimulus<B>,
pub fn from_format<U, B>(color: Alpha<Luma<S, U>, B>) -> Selfwhere T: FromStimulus<U>, A: FromStimulus<B>,
Convert from another component type.
sourcepub fn into_components(self) -> (T, A)
pub fn into_components(self) -> (T, A)
Convert to a (luma, alpha)
tuple.
sourcepub fn from_components((luma, alpha): (T, A)) -> Self
pub fn from_components((luma, alpha): (T, A)) -> Self
Convert from a (luma, alpha)
tuple.
source§impl<S> Alpha<Luma<S, u8>, u8>
impl<S> Alpha<Luma<S, u8>, u8>
sourcepub fn into_u16<O>(self) -> u16where
O: ComponentOrder<Lumaa<S, u8>, u16>,
pub fn into_u16<O>(self) -> u16where O: ComponentOrder<Lumaa<S, u8>, u16>,
Convert to a packed u16
with with a specific component order.
use palette::{luma, SrgbLumaa};
let integer = SrgbLumaa::new(96u8, 255).into_u16::<luma::channels::Al>();
assert_eq!(0xFF60, integer);
It’s also possible to use From
and Into
, which defaults to the
0xLLAA
component order:
use palette::SrgbLumaa;
let integer = u16::from(SrgbLumaa::new(96u8, 255));
assert_eq!(0x60FF, integer);
See Packed for more details.
sourcepub fn from_u16<O>(color: u16) -> Selfwhere
O: ComponentOrder<Lumaa<S, u8>, u16>,
pub fn from_u16<O>(color: u16) -> Selfwhere O: ComponentOrder<Lumaa<S, u8>, u16>,
Convert from a packed u16
with a specific component order.
use palette::{luma, SrgbLumaa};
let luma = SrgbLumaa::from_u16::<luma::channels::Al>(0xFF60);
assert_eq!(SrgbLumaa::new(96u8, 255), luma);
It’s also possible to use From
and Into
, which defaults to the
0xLLAA
component order:
use palette::SrgbLumaa;
let luma = SrgbLumaa::from(0x60FF);
assert_eq!(SrgbLumaa::new(96u8, 255), luma);
See Packed for more details.
source§impl<S, T, A> Alpha<Luma<S, T>, A>where
S: LumaStandard,
impl<S, T, A> Alpha<Luma<S, T>, A>where S: LumaStandard,
sourcepub fn into_linear<U, B>(self) -> Alpha<Luma<Linear<S::WhitePoint>, U>, B>where
S::TransferFn: IntoLinear<U, T>,
B: FromStimulus<A>,
pub fn into_linear<U, B>(self) -> Alpha<Luma<Linear<S::WhitePoint>, U>, B>where S::TransferFn: IntoLinear<U, T>, B: FromStimulus<A>,
Convert the color to linear luminance with transparency.
Some transfer functions allow the component type to be converted at the
same time. This is usually offered with increased performance, compared
to using into_format
.
use palette::{SrgbLumaa, LinLumaa};
let linear: LinLumaa<_, f32> = SrgbLumaa::new(96u8, 38).into_linear();
See the transfer function types in the encoding
module for details and performance characteristics.
sourcepub fn from_linear<U, B>(
color: Alpha<Luma<Linear<S::WhitePoint>, U>, B>
) -> Selfwhere
S::TransferFn: FromLinear<U, T>,
A: FromStimulus<B>,
pub fn from_linear<U, B>( color: Alpha<Luma<Linear<S::WhitePoint>, U>, B> ) -> Selfwhere S::TransferFn: FromLinear<U, T>, A: FromStimulus<B>,
Convert linear luminance to non-linear luminance with transparency.
Some transfer functions allow the component type to be converted at the
same time. This is usually offered with increased performance, compared
to using into_format
.
use palette::{SrgbLumaa, LinLumaa};
let encoded = SrgbLumaa::<u8>::from_linear(LinLumaa::new(0.95f32, 0.75));
See the transfer function types in the encoding
module for details and performance characteristics.
source§impl<Wp, T, A> Alpha<Luma<Linear<Wp>, T>, A>
impl<Wp, T, A> Alpha<Luma<Linear<Wp>, T>, A>
sourcepub fn into_encoding<U, B, St>(self) -> Alpha<Luma<St, U>, B>where
St: LumaStandard<WhitePoint = Wp>,
St::TransferFn: FromLinear<T, U>,
B: FromStimulus<A>,
pub fn into_encoding<U, B, St>(self) -> Alpha<Luma<St, U>, B>where St: LumaStandard<WhitePoint = Wp>, St::TransferFn: FromLinear<T, U>, B: FromStimulus<A>,
Convert a linear color to a different encoding with transparency.
Some transfer functions allow the component type to be converted at the
same time. This is usually offered with increased performance, compared
to using into_format
.
use palette::{SrgbLumaa, LinLumaa};
let encoded: SrgbLumaa<u8> = LinLumaa::new(0.95f32, 0.75).into_encoding();
See the transfer function types in the encoding
module for details and performance characteristics.
sourcepub fn from_encoding<U, B, St>(color: Alpha<Luma<St, U>, B>) -> Selfwhere
St: LumaStandard<WhitePoint = Wp>,
St::TransferFn: IntoLinear<T, U>,
A: FromStimulus<B>,
pub fn from_encoding<U, B, St>(color: Alpha<Luma<St, U>, B>) -> Selfwhere St: LumaStandard<WhitePoint = Wp>, St::TransferFn: IntoLinear<T, U>, A: FromStimulus<B>,
Convert to linear luminance from a different encoding with transparency.
Some transfer functions allow the component type to be converted at the
same time. This is usually offered with increased performance, compared
to using into_format
.
use palette::{SrgbLumaa, LinLumaa};
let linear = LinLumaa::<_, f32>::from_encoding(SrgbLumaa::new(96u8, 38));
See the transfer function types in the encoding
module for details and performance characteristics.
source§impl<S, T, A> Alpha<Luma<S, &mut T>, &mut A>
impl<S, T, A> Alpha<Luma<S, &mut T>, &mut A>
source§impl<S, Ct, Ca> Alpha<Luma<S, Ct>, Ca>
impl<S, Ct, Ca> Alpha<Luma<S, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Luma<S, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Luma<S, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Luma<S, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Luma<S, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<S, T, A> Alpha<Luma<S, Vec<T>>, Vec<A>>
impl<S, T, A> Alpha<Luma<S, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Luma<S, T>, A>)
pub fn push(&mut self, value: Alpha<Luma<S, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Luma<S, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Luma<S, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<Wp, T, A> Alpha<Luv<Wp, T>, A>
impl<Wp, T, A> Alpha<Luv<Wp, T>, A>
Luva
implementations.
sourcepub const fn new(l: T, u: T, v: T, alpha: A) -> Self
pub const fn new(l: T, u: T, v: T, alpha: A) -> Self
Create a CIE L*u*v* color with transparency.
sourcepub fn into_components(self) -> (T, T, T, A)
pub fn into_components(self) -> (T, T, T, A)
Convert to u (L\*, u\*, v\*, alpha)
tuple.
sourcepub fn from_components((l, u, v, alpha): (T, T, T, A)) -> Self
pub fn from_components((l, u, v, alpha): (T, T, T, A)) -> Self
Convert from u (L\*, u\*, v\*, alpha)
tuple.
source§impl<Wp, T, A> Alpha<Luv<Wp, &mut T>, &mut A>
impl<Wp, T, A> Alpha<Luv<Wp, &mut T>, &mut A>
source§impl<Wp, Ct, Ca> Alpha<Luv<Wp, Ct>, Ca>
impl<Wp, Ct, Ca> Alpha<Luv<Wp, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Luv<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Luv<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Luv<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Luv<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<Wp, T, A> Alpha<Luv<Wp, Vec<T>>, Vec<A>>
impl<Wp, T, A> Alpha<Luv<Wp, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Luv<Wp, T>, A>)
pub fn push(&mut self, value: Alpha<Luv<Wp, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Luv<Wp, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Luv<Wp, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<T, A> Alpha<Okhsl<T>, A>
impl<T, A> Alpha<Okhsl<T>, A>
Okhsla
implementations.
sourcepub fn new<H: Into<OklabHue<T>>>(
hue: H,
saturation: T,
lightness: T,
alpha: A
) -> Self
pub fn new<H: Into<OklabHue<T>>>( hue: H, saturation: T, lightness: T, alpha: A ) -> Self
Create an Okhsl
color with transparency.
sourcepub const fn new_const(
hue: OklabHue<T>,
saturation: T,
lightness: T,
alpha: A
) -> Self
pub const fn new_const( hue: OklabHue<T>, saturation: T, lightness: T, alpha: A ) -> Self
Create an Okhsla
color. This is the same as Okhsla::new
without the
generic hue type. It’s temporary until const fn
supports traits.
sourcepub fn into_format<U, B>(self) -> Alpha<Okhsl<U>, B>where
U: FromStimulus<T> + FromAngle<T>,
B: FromStimulus<A>,
pub fn into_format<U, B>(self) -> Alpha<Okhsl<U>, B>where U: FromStimulus<T> + FromAngle<T>, B: FromStimulus<A>,
Convert into another component type.
sourcepub fn from_format<U, B>(color: Alpha<Okhsl<U>, B>) -> Selfwhere
T: FromStimulus<U> + FromAngle<U>,
A: FromStimulus<B>,
pub fn from_format<U, B>(color: Alpha<Okhsl<U>, B>) -> Selfwhere T: FromStimulus<U> + FromAngle<U>, A: FromStimulus<B>,
Convert from another component type.
sourcepub fn into_components(self) -> (OklabHue<T>, T, T, A)
pub fn into_components(self) -> (OklabHue<T>, T, T, A)
Convert to a (hue, saturation, lightness, alpha)
tuple.
sourcepub fn from_components<H: Into<OklabHue<T>>>(
(hue, saturation, lightness, alpha): (H, T, T, A)
) -> Self
pub fn from_components<H: Into<OklabHue<T>>>( (hue, saturation, lightness, alpha): (H, T, T, A) ) -> Self
Convert from a (hue, saturation, lightness, alpha)
tuple.
source§impl<T, A> Alpha<Okhsl<&mut T>, &mut A>
impl<T, A> Alpha<Okhsl<&mut T>, &mut A>
source§impl<Ct, Ca> Alpha<Okhsl<Ct>, Ca>
impl<Ct, Ca> Alpha<Okhsl<Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Okhsl<&<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Okhsl<&<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Okhsl<&mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Okhsl<&mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<T, A> Alpha<Okhsl<Vec<T>>, Vec<A>>
impl<T, A> Alpha<Okhsl<Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Okhsl<T>, A>)
pub fn push(&mut self, value: Alpha<Okhsl<T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Okhsl<T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Okhsl<T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<T, A> Alpha<Okhsv<T>, A>
impl<T, A> Alpha<Okhsv<T>, A>
Hsva
implementations.
sourcepub fn new<H: Into<OklabHue<T>>>(
hue: H,
saturation: T,
value: T,
alpha: A
) -> Self
pub fn new<H: Into<OklabHue<T>>>( hue: H, saturation: T, value: T, alpha: A ) -> Self
Create an Okhsv
color with transparency.
sourcepub const fn new_const(
hue: OklabHue<T>,
saturation: T,
value: T,
alpha: A
) -> Self
pub const fn new_const( hue: OklabHue<T>, saturation: T, value: T, alpha: A ) -> Self
Create an Okhsva
color. This is the same as Okhsva::new
without the
generic hue type. It’s temporary until const fn
supports traits.
sourcepub fn into_format<U, B>(self) -> Alpha<Okhsv<U>, B>where
U: FromStimulus<T> + FromAngle<T>,
B: FromStimulus<A>,
pub fn into_format<U, B>(self) -> Alpha<Okhsv<U>, B>where U: FromStimulus<T> + FromAngle<T>, B: FromStimulus<A>,
Convert into another component type.
sourcepub fn from_format<U, B>(color: Alpha<Okhsv<U>, B>) -> Selfwhere
T: FromStimulus<U> + FromAngle<U>,
A: FromStimulus<B>,
U: Zero + MinMax,
pub fn from_format<U, B>(color: Alpha<Okhsv<U>, B>) -> Selfwhere T: FromStimulus<U> + FromAngle<U>, A: FromStimulus<B>, U: Zero + MinMax,
Convert from another component type.
sourcepub fn into_components(self) -> (OklabHue<T>, T, T, A)
pub fn into_components(self) -> (OklabHue<T>, T, T, A)
Convert to a (hue, saturation, value, alpha)
tuple.
sourcepub fn from_components<H: Into<OklabHue<T>>>(
(hue, saturation, value, alpha): (H, T, T, A)
) -> Self
pub fn from_components<H: Into<OklabHue<T>>>( (hue, saturation, value, alpha): (H, T, T, A) ) -> Self
Convert from a (hue, saturation, value, alpha)
tuple.
source§impl<T, A> Alpha<Okhsv<&mut T>, &mut A>
impl<T, A> Alpha<Okhsv<&mut T>, &mut A>
source§impl<Ct, Ca> Alpha<Okhsv<Ct>, Ca>
impl<Ct, Ca> Alpha<Okhsv<Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Okhsv<&<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Okhsv<&<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Okhsv<&mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Okhsv<&mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<T, A> Alpha<Okhsv<Vec<T>>, Vec<A>>
impl<T, A> Alpha<Okhsv<Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Okhsv<T>, A>)
pub fn push(&mut self, value: Alpha<Okhsv<T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Okhsv<T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Okhsv<T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<T, A> Alpha<Okhwb<T>, A>
impl<T, A> Alpha<Okhwb<T>, A>
Okhwba
implementations.
sourcepub fn new<H: Into<OklabHue<T>>>(
hue: H,
whiteness: T,
blackness: T,
alpha: A
) -> Self
pub fn new<H: Into<OklabHue<T>>>( hue: H, whiteness: T, blackness: T, alpha: A ) -> Self
Create an Okhwb
color with transparency.
sourcepub const fn new_const(
hue: OklabHue<T>,
whiteness: T,
blackness: T,
alpha: A
) -> Self
pub const fn new_const( hue: OklabHue<T>, whiteness: T, blackness: T, alpha: A ) -> Self
Create an Okhwba
color. This is the same as Okhwba::new
without the
generic hue type. It’s temporary until const fn
supports traits.
sourcepub fn into_format<U, B>(self) -> Alpha<Okhwb<U>, B>where
U: FromStimulus<T> + FromAngle<T>,
B: FromStimulus<A>,
pub fn into_format<U, B>(self) -> Alpha<Okhwb<U>, B>where U: FromStimulus<T> + FromAngle<T>, B: FromStimulus<A>,
Convert into another component type.
sourcepub fn from_format<U, B>(color: Alpha<Okhwb<U>, B>) -> Selfwhere
T: FromStimulus<U> + FromAngle<U>,
A: FromStimulus<B>,
pub fn from_format<U, B>(color: Alpha<Okhwb<U>, B>) -> Selfwhere T: FromStimulus<U> + FromAngle<U>, A: FromStimulus<B>,
Convert from another component type.
sourcepub fn into_components(self) -> (OklabHue<T>, T, T, A)
pub fn into_components(self) -> (OklabHue<T>, T, T, A)
Convert to a (hue, whiteness, blackness, alpha)
tuple.
sourcepub fn from_components<H: Into<OklabHue<T>>>(
(hue, whiteness, blackness, alpha): (H, T, T, A)
) -> Self
pub fn from_components<H: Into<OklabHue<T>>>( (hue, whiteness, blackness, alpha): (H, T, T, A) ) -> Self
Convert from a (hue, whiteness, blackness, alpha)
tuple.
source§impl<T, A> Alpha<Okhwb<&mut T>, &mut A>
impl<T, A> Alpha<Okhwb<&mut T>, &mut A>
source§impl<Ct, Ca> Alpha<Okhwb<Ct>, Ca>
impl<Ct, Ca> Alpha<Okhwb<Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Okhwb<&<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Okhwb<&<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Okhwb<&mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Okhwb<&mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<T, A> Alpha<Okhwb<Vec<T>>, Vec<A>>
impl<T, A> Alpha<Okhwb<Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Okhwb<T>, A>)
pub fn push(&mut self, value: Alpha<Okhwb<T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Okhwb<T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Okhwb<T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<T, A> Alpha<Oklab<T>, A>
impl<T, A> Alpha<Oklab<T>, A>
Oklaba
implementations.
sourcepub fn into_components(self) -> (T, T, T, A)
pub fn into_components(self) -> (T, T, T, A)
Convert to a (L, a, b, alpha)
tuple.
sourcepub fn from_components((l, a, b, alpha): (T, T, T, A)) -> Self
pub fn from_components((l, a, b, alpha): (T, T, T, A)) -> Self
Convert from a (L, a, b, alpha)
tuple.
source§impl<T, A> Alpha<Oklab<&mut T>, &mut A>
impl<T, A> Alpha<Oklab<&mut T>, &mut A>
source§impl<Ct, Ca> Alpha<Oklab<Ct>, Ca>
impl<Ct, Ca> Alpha<Oklab<Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Oklab<&<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Oklab<&<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Oklab<&mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Oklab<&mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<T, A> Alpha<Oklab<Vec<T>>, Vec<A>>
impl<T, A> Alpha<Oklab<Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Oklab<T>, A>)
pub fn push(&mut self, value: Alpha<Oklab<T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Oklab<T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Oklab<T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<T, A> Alpha<Oklch<T>, A>
impl<T, A> Alpha<Oklch<T>, A>
Oklcha
implementations.
sourcepub fn new<H: Into<OklabHue<T>>>(l: T, chroma: T, hue: H, alpha: A) -> Self
pub fn new<H: Into<OklabHue<T>>>(l: T, chroma: T, hue: H, alpha: A) -> Self
Create an Oklch color with transparency.
sourcepub const fn new_const(l: T, chroma: T, hue: OklabHue<T>, alpha: A) -> Self
pub const fn new_const(l: T, chroma: T, hue: OklabHue<T>, alpha: A) -> Self
Create an Oklcha
color. This is the same as Oklcha::new
without the
generic hue type. It’s temporary until const fn
supports traits.
sourcepub fn into_components(self) -> (T, T, OklabHue<T>, A)
pub fn into_components(self) -> (T, T, OklabHue<T>, A)
Convert to a (L, C, h, alpha)
tuple.
sourcepub fn from_components<H: Into<OklabHue<T>>>(
(l, chroma, hue, alpha): (T, T, H, A)
) -> Self
pub fn from_components<H: Into<OklabHue<T>>>( (l, chroma, hue, alpha): (T, T, H, A) ) -> Self
Convert from a (L, C, h, alpha)
tuple.
source§impl<T, A> Alpha<Oklch<&mut T>, &mut A>
impl<T, A> Alpha<Oklch<&mut T>, &mut A>
source§impl<Ct, Ca> Alpha<Oklch<Ct>, Ca>
impl<Ct, Ca> Alpha<Oklch<Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Oklch<&<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Oklch<&<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Oklch<&mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Oklch<&mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<T, A> Alpha<Oklch<Vec<T>>, Vec<A>>
impl<T, A> Alpha<Oklch<Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Oklch<T>, A>)
pub fn push(&mut self, value: Alpha<Oklch<T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Oklch<T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Oklch<T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<S, T, A> Alpha<Rgb<S, T>, A>
impl<S, T, A> Alpha<Rgb<S, T>, A>
Rgba
implementations.
sourcepub fn into_format<U, B>(self) -> Alpha<Rgb<S, U>, B>where
U: FromStimulus<T>,
B: FromStimulus<A>,
pub fn into_format<U, B>(self) -> Alpha<Rgb<S, U>, B>where U: FromStimulus<T>, B: FromStimulus<A>,
Convert into another component type.
sourcepub fn from_format<U, B>(color: Alpha<Rgb<S, U>, B>) -> Selfwhere
T: FromStimulus<U>,
A: FromStimulus<B>,
pub fn from_format<U, B>(color: Alpha<Rgb<S, U>, B>) -> Selfwhere T: FromStimulus<U>, A: FromStimulus<B>,
Convert from another component type.
sourcepub fn into_components(self) -> (T, T, T, A)
pub fn into_components(self) -> (T, T, T, A)
Convert to a (red, green, blue, alpha)
tuple.
sourcepub fn from_components((red, green, blue, alpha): (T, T, T, A)) -> Self
pub fn from_components((red, green, blue, alpha): (T, T, T, A)) -> Self
Convert from a (red, green, blue, alpha)
tuple.
source§impl<S> Alpha<Rgb<S, u8>, u8>
impl<S> Alpha<Rgb<S, u8>, u8>
sourcepub fn into_u32<O>(self) -> u32where
O: ComponentOrder<Rgba<S, u8>, u32>,
pub fn into_u32<O>(self) -> u32where O: ComponentOrder<Rgba<S, u8>, u32>,
Convert to a packed u32
with with specifiable component order.
use palette::{rgb, Srgba};
let integer = Srgba::new(96u8, 127, 0, 255).into_u32::<rgb::channels::Argb>();
assert_eq!(0xFF607F00, integer);
It’s also possible to use From
and Into
, which defaults to the
0xRRGGBBAA
component order:
use palette::Srgba;
let integer = u32::from(Srgba::new(96u8, 127, 0, 255));
assert_eq!(0x607F00FF, integer);
See Packed for more details.
sourcepub fn from_u32<O>(color: u32) -> Selfwhere
O: ComponentOrder<Rgba<S, u8>, u32>,
pub fn from_u32<O>(color: u32) -> Selfwhere O: ComponentOrder<Rgba<S, u8>, u32>,
Convert from a packed u32
with specifiable component order.
use palette::{rgb, Srgba};
let rgba = Srgba::from_u32::<rgb::channels::Argb>(0xFF607F00);
assert_eq!(Srgba::new(96u8, 127, 0, 255), rgba);
It’s also possible to use From
and Into
, which defaults to the
0xRRGGBBAA
component order:
use palette::Srgba;
let rgba = Srgba::from(0x607F00FF);
assert_eq!(Srgba::new(96u8, 127, 0, 255), rgba);
See Packed for more details.
source§impl<S: RgbStandard, T, A> Alpha<Rgb<S, T>, A>
impl<S: RgbStandard, T, A> Alpha<Rgb<S, T>, A>
sourcepub fn into_linear<U, B>(self) -> Alpha<Rgb<Linear<S::Space>, U>, B>where
S::TransferFn: IntoLinear<U, T>,
B: FromStimulus<A>,
pub fn into_linear<U, B>(self) -> Alpha<Rgb<Linear<S::Space>, U>, B>where S::TransferFn: IntoLinear<U, T>, B: FromStimulus<A>,
Convert the color to linear RGB with transparency.
Some transfer functions allow the component type to be converted at the
same time. This is usually offered with increased performance, compared
to using into_format
.
use palette::{Srgba, LinSrgba};
let linear: LinSrgba<f32> = Srgba::new(96u8, 127, 0, 38).into_linear();
See the transfer function types in the encoding
module for details and performance characteristics.
sourcepub fn from_linear<U, B>(color: Alpha<Rgb<Linear<S::Space>, U>, B>) -> Selfwhere
S::TransferFn: FromLinear<U, T>,
A: FromStimulus<B>,
pub fn from_linear<U, B>(color: Alpha<Rgb<Linear<S::Space>, U>, B>) -> Selfwhere S::TransferFn: FromLinear<U, T>, A: FromStimulus<B>,
Convert linear RGB to non-linear RGB with transparency.
Some transfer functions allow the component type to be converted at the
same time. This is usually offered with increased performance, compared
to using into_format
.
use palette::{Srgba, LinSrgba};
let encoded = Srgba::<u8>::from_linear(LinSrgba::new(0.95f32, 0.90, 0.30, 0.75));
See the transfer function types in the encoding
module for details and performance characteristics.
source§impl<S: RgbSpace, T, A> Alpha<Rgb<Linear<S>, T>, A>
impl<S: RgbSpace, T, A> Alpha<Rgb<Linear<S>, T>, A>
sourcepub fn into_encoding<U, B, St>(self) -> Alpha<Rgb<St, U>, B>where
St: RgbStandard<Space = S>,
St::TransferFn: FromLinear<T, U>,
B: FromStimulus<A>,
pub fn into_encoding<U, B, St>(self) -> Alpha<Rgb<St, U>, B>where St: RgbStandard<Space = S>, St::TransferFn: FromLinear<T, U>, B: FromStimulus<A>,
Convert a linear color to a different encoding with transparency.
Some transfer functions allow the component type to be converted at the
same time. This is usually offered with increased performance, compared
to using into_format
.
use palette::{Srgba, LinSrgba};
let encoded: Srgba<u8> = LinSrgba::new(0.95f32, 0.90, 0.30, 0.75).into_encoding();
See the transfer function types in the encoding
module for details and performance characteristics.
sourcepub fn from_encoding<U, B, St>(color: Alpha<Rgb<St, U>, B>) -> Selfwhere
St: RgbStandard<Space = S>,
St::TransferFn: IntoLinear<T, U>,
A: FromStimulus<B>,
pub fn from_encoding<U, B, St>(color: Alpha<Rgb<St, U>, B>) -> Selfwhere St: RgbStandard<Space = S>, St::TransferFn: IntoLinear<T, U>, A: FromStimulus<B>,
Convert RGB from a different encoding to linear with transparency.
Some transfer functions allow the component type to be converted at the
same time. This is usually offered with increased performance, compared
to using into_format
.
use palette::{Srgba, LinSrgba};
let linear = LinSrgba::<f32>::from_encoding(Srgba::new(96u8, 127, 0, 38));
See the transfer function types in the encoding
module for details and performance characteristics.
source§impl<S, T, A> Alpha<Rgb<S, &mut T>, &mut A>
impl<S, T, A> Alpha<Rgb<S, &mut T>, &mut A>
source§impl<S, Ct, Ca> Alpha<Rgb<S, Ct>, Ca>
impl<S, Ct, Ca> Alpha<Rgb<S, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Rgb<S, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Rgb<S, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Rgb<S, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Rgb<S, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<S, T, A> Alpha<Rgb<S, Vec<T>>, Vec<A>>
impl<S, T, A> Alpha<Rgb<S, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Rgb<S, T>, A>)
pub fn push(&mut self, value: Alpha<Rgb<S, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Rgb<S, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Rgb<S, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<Wp, T, A> Alpha<Xyz<Wp, T>, A>
impl<Wp, T, A> Alpha<Xyz<Wp, T>, A>
Xyza
implementations.
sourcepub fn into_components(self) -> (T, T, T, A)
pub fn into_components(self) -> (T, T, T, A)
Convert to a (X, Y, Z, alpha)
tuple.
sourcepub fn from_components((x, y, z, alpha): (T, T, T, A)) -> Self
pub fn from_components((x, y, z, alpha): (T, T, T, A)) -> Self
Convert from a (X, Y, Z, alpha)
tuple.
sourcepub fn with_white_point<NewWp>(self) -> Alpha<Xyz<NewWp, T>, A>
pub fn with_white_point<NewWp>(self) -> Alpha<Xyz<NewWp, T>, A>
Changes the reference white point without changing the color value.
This function doesn’t change the numerical values, and thus the color it represents in an absolute sense. However, the appearance of the color may not be the same when observed with the new white point. The effect would be similar to taking a photo with an incorrect white balance.
See chromatic_adaptation for operations that can change the white point while preserving the color’s appearance.
source§impl<Wp, T, A> Alpha<Xyz<Wp, &mut T>, &mut A>
impl<Wp, T, A> Alpha<Xyz<Wp, &mut T>, &mut A>
source§impl<Wp, Ct, Ca> Alpha<Xyz<Wp, Ct>, Ca>
impl<Wp, Ct, Ca> Alpha<Xyz<Wp, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Xyz<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Xyz<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Xyz<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Xyz<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<Wp, T, A> Alpha<Xyz<Wp, Vec<T>>, Vec<A>>
impl<Wp, T, A> Alpha<Xyz<Wp, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Xyz<Wp, T>, A>)
pub fn push(&mut self, value: Alpha<Xyz<Wp, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Xyz<Wp, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Xyz<Wp, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
source§impl<Wp, T, A> Alpha<Yxy<Wp, T>, A>
impl<Wp, T, A> Alpha<Yxy<Wp, T>, A>
Yxya
implementations.
sourcepub const fn new(x: T, y: T, luma: T, alpha: A) -> Self
pub const fn new(x: T, y: T, luma: T, alpha: A) -> Self
Create a CIE Yxy color with transparency.
sourcepub fn into_components(self) -> (T, T, T, A)
pub fn into_components(self) -> (T, T, T, A)
Convert to a (x, y, luma)
, a.k.a. (x, y, Y)
tuple.
sourcepub fn from_components((x, y, luma, alpha): (T, T, T, A)) -> Self
pub fn from_components((x, y, luma, alpha): (T, T, T, A)) -> Self
Convert from a (x, y, luma)
, a.k.a. (x, y, Y)
tuple.
sourcepub fn with_white_point<NewWp>(self) -> Alpha<Yxy<NewWp, T>, A>
pub fn with_white_point<NewWp>(self) -> Alpha<Yxy<NewWp, T>, A>
Changes the reference white point without changing the color value.
This function doesn’t change the numerical values, and thus the color it represents in an absolute sense. However, the appearance of the color may not be the same when observed with the new white point. The effect would be similar to taking a photo with an incorrect white balance.
See chromatic_adaptation for operations that can change the white point while preserving the color’s appearance.
source§impl<Wp, T, A> Alpha<Yxy<Wp, &mut T>, &mut A>
impl<Wp, T, A> Alpha<Yxy<Wp, &mut T>, &mut A>
source§impl<Wp, Ct, Ca> Alpha<Yxy<Wp, Ct>, Ca>
impl<Wp, Ct, Ca> Alpha<Yxy<Wp, Ct>, Ca>
sourcepub fn get<'a, I, T, A>(
&'a self,
index: I
) -> Option<Alpha<Yxy<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsRef<[T]>,
Ca: AsRef<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get<'a, I, T, A>( &'a self, index: I ) -> Option<Alpha<Yxy<Wp, &<I as SliceIndex<[T]>>::Output>, &<I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsRef<[T]>, Ca: AsRef<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, with references to the components at index
. See slice::get
for details.
sourcepub fn get_mut<'a, I, T, A>(
&'a mut self,
index: I
) -> Option<Alpha<Yxy<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where
T: 'a,
A: 'a,
Ct: AsMut<[T]>,
Ca: AsMut<[A]>,
I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I ) -> Option<Alpha<Yxy<Wp, &mut <I as SliceIndex<[T]>>::Output>, &mut <I as SliceIndex<[A]>>::Output>>where T: 'a, A: 'a, Ct: AsMut<[T]>, Ca: AsMut<[A]>, I: SliceIndex<[T]> + SliceIndex<[A]> + Clone,
Get a color, or slice of colors, that allows modifying the components at index
. See slice::get_mut
for details.
source§impl<Wp, T, A> Alpha<Yxy<Wp, Vec<T>>, Vec<A>>
impl<Wp, T, A> Alpha<Yxy<Wp, Vec<T>>, Vec<A>>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a struct of vectors with a minimum capacity. See Vec::with_capacity
for details.
sourcepub fn push(&mut self, value: Alpha<Yxy<Wp, T>, A>)
pub fn push(&mut self, value: Alpha<Yxy<Wp, T>, A>)
Push an additional color’s components onto the component vectors. See Vec::push
for details.
sourcepub fn pop(&mut self) -> Option<Alpha<Yxy<Wp, T>, A>>
pub fn pop(&mut self) -> Option<Alpha<Yxy<Wp, T>, A>>
Pop a color’s components from the component vectors. See Vec::pop
for details.
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the component vectors. See Vec::clear
for details.
Trait Implementations§
source§impl<C, T> AbsDiffEq<Alpha<C, T>> for Alpha<C, T>where
C: AbsDiffEq<Epsilon = T::Epsilon>,
T: AbsDiffEq,
T::Epsilon: Clone,
impl<C, T> AbsDiffEq<Alpha<C, T>> for Alpha<C, T>where C: AbsDiffEq<Epsilon = T::Epsilon>, T: AbsDiffEq, T::Epsilon: Clone,
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
source§fn abs_diff_eq(&self, other: &Self, epsilon: T::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: T::Epsilon) -> bool
source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
.source§impl<C, T> AddAssign<Alpha<C, T>> for Alpha<C, T>where
C: AddAssign,
T: AddAssign,
impl<C, T> AddAssign<Alpha<C, T>> for Alpha<C, T>where C: AddAssign, T: AddAssign,
source§fn add_assign(&mut self, other: Alpha<C, T>)
fn add_assign(&mut self, other: Alpha<C, T>)
+=
operation. Read moresource§impl<T, C> AddAssign<T> for Alpha<C, T>where
T: AddAssign + Clone,
C: AddAssign<T>,
impl<T, C> AddAssign<T> for Alpha<C, T>where T: AddAssign + Clone, C: AddAssign<T>,
source§fn add_assign(&mut self, c: T)
fn add_assign(&mut self, c: T)
+=
operation. Read moresource§impl<C> ArrayCast for Alpha<C, <<C as ArrayCast>::Array as ArrayExt>::Item>where
C: ArrayCast,
C::Array: NextArray,
impl<C> ArrayCast for Alpha<C, <<C as ArrayCast>::Array as ArrayExt>::Item>where C: ArrayCast, C::Array: NextArray,
source§impl<C, T, const N: usize> AsMut<[T]> for Alpha<C, T>where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<C, T, const N: usize> AsMut<[T]> for Alpha<C, T>where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<C, T, const N: usize> AsMut<[T; N]> for Alpha<C, T>where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<C, T, const N: usize> AsMut<[T; N]> for Alpha<C, T>where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<C, T, const N: usize> AsMut<Alpha<C, T>> for [T; N]where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<C, T, const N: usize> AsMut<Alpha<C, T>> for [T; N]where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<C, T, const N: usize> AsRef<[T]> for Alpha<C, T>where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<C, T, const N: usize> AsRef<[T]> for Alpha<C, T>where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<C, T, const N: usize> AsRef<[T; N]> for Alpha<C, T>where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<C, T, const N: usize> AsRef<[T; N]> for Alpha<C, T>where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<C, T, const N: usize> AsRef<Alpha<C, T>> for [T; N]where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<C, T, const N: usize> AsRef<Alpha<C, T>> for [T; N]where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<C, T, const N: usize> Blend for Alpha<C, T>where
C: Premultiply<Scalar = T> + StimulusColor + ArrayCast<Array = [T; N]> + Clone,
T: Real + Zero + One + MinMax + Clamp + Sqrt + Abs + Arithmetics + PartialCmp + Clone,
T::Mask: LazySelect<T>,
impl<C, T, const N: usize> Blend for Alpha<C, T>where C: Premultiply<Scalar = T> + StimulusColor + ArrayCast<Array = [T; N]> + Clone, T: Real + Zero + One + MinMax + Clamp + Sqrt + Abs + Arithmetics + PartialCmp + Clone, T::Mask: LazySelect<T>,
source§fn multiply(self, other: Self) -> Self
fn multiply(self, other: Self) -> Self
self
with other
. This uses the alpha component to regulate
the effect, so it’s not just plain component wise multiplication.source§fn screen(self, other: Self) -> Self
fn screen(self, other: Self) -> Self
self
or other
.source§fn overlay(self, other: Self) -> Self
fn overlay(self, other: Self) -> Self
self
or other
if other is dark, or screen them if other
is light. This results in an S curve.source§fn dodge(self, other: Self) -> Self
fn dodge(self, other: Self) -> Self
other
to reflect self
. Results in other
if self
is
black.source§fn burn(self, other: Self) -> Self
fn burn(self, other: Self) -> Self
other
to reflect self
. Results in other
if self
is
white.source§fn hard_light(self, other: Self) -> Self
fn hard_light(self, other: Self) -> Self
self
or other
if other is dark, or screen them if self
is light. This is similar to overlay
, but depends on self
instead
of other
.source§fn soft_light(self, other: Self) -> Self
fn soft_light(self, other: Self) -> Self
other
if self
is light, or darken other
as if it’s burned
if self
is dark. The effect is increased if the components of self
is further from 0.5.source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
self
and other
. It’s
basically abs(self - other)
, but regulated by the alpha component.source§impl<C> BlendWith for Alpha<C, C::Scalar>where
C: Premultiply,
impl<C> BlendWith for Alpha<C, C::Scalar>where C: Premultiply,
source§fn blend_with<F>(self, destination: Self, blend_function: F) -> Selfwhere
F: BlendFunction<Self::Color>,
fn blend_with<F>(self, destination: Self, blend_function: F) -> Selfwhere F: BlendFunction<Self::Color>,
destination
, using
blend_function
. Anything that implements BlendFunction
is
acceptable, including functions and closures. Read moresource§impl<C, T> ClampAssign for Alpha<C, T>where
C: ClampAssign,
T: Stimulus + ClampAssign,
impl<C, T> ClampAssign for Alpha<C, T>where C: ClampAssign, T: Stimulus + ClampAssign,
source§fn clamp_assign(&mut self)
fn clamp_assign(&mut self)
source§impl<C> Compose for Alpha<C, C::Scalar>where
C: Premultiply,
PreAlpha<C>: Compose,
impl<C> Compose for Alpha<C, C::Scalar>where C: Premultiply, PreAlpha<C>: Compose,
source§fn over(self, other: Self) -> Self
fn over(self, other: Self) -> Self
self
over other
. This is the good old common alpha composition
equation.source§fn inside(self, other: Self) -> Self
fn inside(self, other: Self) -> Self
self
that overlaps the visible parts of
other
.source§impl<'de, C, T> Deserialize<'de> for Alpha<C, T>where
C: Deserialize<'de>,
T: Deserialize<'de>,
impl<'de, C, T> Deserialize<'de> for Alpha<C, T>where C: Deserialize<'de>, T: 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>,
source§impl<C, T> Distribution<Alpha<C, T>> for Standardwhere
Standard: Distribution<C> + Distribution<T>,
impl<C, T> Distribution<Alpha<C, T>> for Standardwhere Standard: Distribution<C> + Distribution<T>,
source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Alpha<C, T>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Alpha<C, T>
T
, using rng
as the source of randomness.source§impl<C, T> DivAssign<Alpha<C, T>> for Alpha<C, T>where
C: DivAssign,
T: DivAssign,
impl<C, T> DivAssign<Alpha<C, T>> for Alpha<C, T>where C: DivAssign, T: DivAssign,
source§fn div_assign(&mut self, other: Alpha<C, T>)
fn div_assign(&mut self, other: Alpha<C, T>)
/=
operation. Read moresource§impl<T, C> DivAssign<T> for Alpha<C, T>where
T: DivAssign + Clone,
C: DivAssign<T>,
impl<T, C> DivAssign<T> for Alpha<C, T>where T: DivAssign + Clone, C: DivAssign<T>,
source§fn div_assign(&mut self, c: T)
fn div_assign(&mut self, c: T)
/=
operation. Read moresource§impl<Tc, Ta, C, A> Extend<Alpha<Tc, Ta>> for Alpha<C, A>where
C: Extend<Tc>,
A: Extend<Ta>,
impl<Tc, Ta, C, A> Extend<Alpha<Tc, Ta>> for Alpha<C, A>where C: Extend<Tc>, A: Extend<Ta>,
source§fn extend<T: IntoIterator<Item = Alpha<Tc, Ta>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Alpha<Tc, Ta>>>(&mut self, iter: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl<'a, C, T, const N: usize> From<&'a [T; N]> for &'a Alpha<C, T>where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<'a, C, T, const N: usize> From<&'a [T; N]> for &'a Alpha<C, T>where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<'a, C, T, const N: usize> From<&'a Alpha<C, T>> for &'a [T]where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<'a, C, T, const N: usize> From<&'a Alpha<C, T>> for &'a [T]where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<'a, C, T, const N: usize> From<&'a Alpha<C, T>> for &'a [T; N]where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<'a, C, T, const N: usize> From<&'a Alpha<C, T>> for &'a [T; N]where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<'a, C, T, const N: usize> From<&'a mut [T; N]> for &'a mut Alpha<C, T>where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<'a, C, T, const N: usize> From<&'a mut [T; N]> for &'a mut Alpha<C, T>where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<'a, C, T, const N: usize> From<&'a mut Alpha<C, T>> for &'a mut [T]where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<'a, C, T, const N: usize> From<&'a mut Alpha<C, T>> for &'a mut [T]where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<'a, C, T, const N: usize> From<&'a mut Alpha<C, T>> for &'a mut [T; N]where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<'a, C, T, const N: usize> From<&'a mut Alpha<C, T>> for &'a mut [T; N]where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<S, T, V, const N: usize> From<[Alpha<Hsl<S, T>, T>; N]> for Alpha<Hsl<S, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<S, T, V, const N: usize> From<[Alpha<Hsl<S, T>, T>; N]> for Alpha<Hsl<S, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<[Alpha<Hsluv<Wp, T>, T>; N]> for Alpha<Hsluv<Wp, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<[Alpha<Hsluv<Wp, T>, T>; N]> for Alpha<Hsluv<Wp, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<S, T, V, const N: usize> From<[Alpha<Hsv<S, T>, T>; N]> for Alpha<Hsv<S, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<S, T, V, const N: usize> From<[Alpha<Hsv<S, T>, T>; N]> for Alpha<Hsv<S, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<S, T, V, const N: usize> From<[Alpha<Hwb<S, T>, T>; N]> for Alpha<Hwb<S, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<S, T, V, const N: usize> From<[Alpha<Hwb<S, T>, T>; N]> for Alpha<Hwb<S, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<[Alpha<Lab<Wp, T>, T>; N]> for Alpha<Lab<Wp, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<[Alpha<Lab<Wp, T>, T>; N]> for Alpha<Lab<Wp, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<[Alpha<Lch<Wp, T>, T>; N]> for Alpha<Lch<Wp, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<[Alpha<Lch<Wp, T>, T>; N]> for Alpha<Lch<Wp, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<[Alpha<Lchuv<Wp, T>, T>; N]> for Alpha<Lchuv<Wp, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<[Alpha<Lchuv<Wp, T>, T>; N]> for Alpha<Lchuv<Wp, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<S, T, V, const N: usize> From<[Alpha<Luma<S, T>, T>; N]> for Alpha<Luma<S, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<S, T, V, const N: usize> From<[Alpha<Luma<S, T>, T>; N]> for Alpha<Luma<S, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<[Alpha<Luv<Wp, T>, T>; N]> for Alpha<Luv<Wp, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<[Alpha<Luv<Wp, T>, T>; N]> for Alpha<Luv<Wp, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<T, V, const N: usize> From<[Alpha<Okhsl<T>, T>; N]> for Alpha<Okhsl<V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<T, V, const N: usize> From<[Alpha<Okhsl<T>, T>; N]> for Alpha<Okhsl<V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<T, V, const N: usize> From<[Alpha<Okhsv<T>, T>; N]> for Alpha<Okhsv<V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<T, V, const N: usize> From<[Alpha<Okhsv<T>, T>; N]> for Alpha<Okhsv<V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<T, V, const N: usize> From<[Alpha<Okhwb<T>, T>; N]> for Alpha<Okhwb<V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<T, V, const N: usize> From<[Alpha<Okhwb<T>, T>; N]> for Alpha<Okhwb<V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<T, V, const N: usize> From<[Alpha<Oklab<T>, T>; N]> for Alpha<Oklab<V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<T, V, const N: usize> From<[Alpha<Oklab<T>, T>; N]> for Alpha<Oklab<V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<T, V, const N: usize> From<[Alpha<Oklch<T>, T>; N]> for Alpha<Oklch<V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<T, V, const N: usize> From<[Alpha<Oklch<T>, T>; N]> for Alpha<Oklch<V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<S, T, V, const N: usize> From<[Alpha<Rgb<S, T>, T>; N]> for Alpha<Rgb<S, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<S, T, V, const N: usize> From<[Alpha<Rgb<S, T>, T>; N]> for Alpha<Rgb<S, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<[Alpha<Xyz<Wp, T>, T>; N]> for Alpha<Xyz<Wp, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<[Alpha<Xyz<Wp, T>, T>; N]> for Alpha<Xyz<Wp, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<[Alpha<Yxy<Wp, T>, T>; N]> for Alpha<Yxy<Wp, V>, V>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<[Alpha<Yxy<Wp, T>, T>; N]> for Alpha<Yxy<Wp, V>, V>where [T; N]: Default, V: FromScalarArray<N, Scalar = T>,
source§impl<C, T, const N: usize> From<[T; N]> for Alpha<C, T>where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<C, T, const N: usize> From<[T; N]> for Alpha<C, T>where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<S, T, H: Into<RgbHue<T>>, A> From<(H, T, T, A)> for Alpha<Hsl<S, T>, A>
impl<S, T, H: Into<RgbHue<T>>, A> From<(H, T, T, A)> for Alpha<Hsl<S, T>, A>
source§fn from(components: (H, T, T, A)) -> Self
fn from(components: (H, T, T, A)) -> Self
source§impl<Wp, T, H: Into<LuvHue<T>>, A> From<(H, T, T, A)> for Alpha<Hsluv<Wp, T>, A>
impl<Wp, T, H: Into<LuvHue<T>>, A> From<(H, T, T, A)> for Alpha<Hsluv<Wp, T>, A>
source§fn from(components: (H, T, T, A)) -> Self
fn from(components: (H, T, T, A)) -> Self
source§impl<S, T, H: Into<RgbHue<T>>, A> From<(H, T, T, A)> for Alpha<Hsv<S, T>, A>
impl<S, T, H: Into<RgbHue<T>>, A> From<(H, T, T, A)> for Alpha<Hsv<S, T>, A>
source§fn from(components: (H, T, T, A)) -> Self
fn from(components: (H, T, T, A)) -> Self
source§impl<S, T, H: Into<RgbHue<T>>, A> From<(H, T, T, A)> for Alpha<Hwb<S, T>, A>
impl<S, T, H: Into<RgbHue<T>>, A> From<(H, T, T, A)> for Alpha<Hwb<S, T>, A>
source§fn from(components: (H, T, T, A)) -> Self
fn from(components: (H, T, T, A)) -> Self
source§impl<T, H: Into<OklabHue<T>>, A> From<(H, T, T, A)> for Alpha<Okhsv<T>, A>
impl<T, H: Into<OklabHue<T>>, A> From<(H, T, T, A)> for Alpha<Okhsv<T>, A>
source§fn from(components: (H, T, T, A)) -> Self
fn from(components: (H, T, T, A)) -> Self
source§impl<Wp, T, H: Into<LabHue<T>>, A> From<(T, T, H, A)> for Alpha<Lch<Wp, T>, A>
impl<Wp, T, H: Into<LabHue<T>>, A> From<(T, T, H, A)> for Alpha<Lch<Wp, T>, A>
source§fn from(components: (T, T, H, A)) -> Self
fn from(components: (T, T, H, A)) -> Self
source§impl<Wp, T, H: Into<LuvHue<T>>, A> From<(T, T, H, A)> for Alpha<Lchuv<Wp, T>, A>
impl<Wp, T, H: Into<LuvHue<T>>, A> From<(T, T, H, A)> for Alpha<Lchuv<Wp, T>, A>
source§fn from(components: (T, T, H, A)) -> Self
fn from(components: (T, T, H, A)) -> Self
source§impl<T, H: Into<OklabHue<T>>, A> From<(T, T, H, A)> for Alpha<Oklch<T>, A>
impl<T, H: Into<OklabHue<T>>, A> From<(T, T, H, A)> for Alpha<Oklch<T>, A>
source§fn from(components: (T, T, H, A)) -> Self
fn from(components: (T, T, H, A)) -> Self
source§impl<Wp, T, A> From<(T, T, T, A)> for Alpha<Lab<Wp, T>, A>
impl<Wp, T, A> From<(T, T, T, A)> for Alpha<Lab<Wp, T>, A>
source§fn from(components: (T, T, T, A)) -> Self
fn from(components: (T, T, T, A)) -> Self
source§impl<Wp, T, A> From<(T, T, T, A)> for Alpha<Luv<Wp, T>, A>
impl<Wp, T, A> From<(T, T, T, A)> for Alpha<Luv<Wp, T>, A>
source§fn from(components: (T, T, T, A)) -> Self
fn from(components: (T, T, T, A)) -> Self
source§impl<T, A> From<(T, T, T, A)> for Alpha<Oklab<T>, A>
impl<T, A> From<(T, T, T, A)> for Alpha<Oklab<T>, A>
source§fn from(components: (T, T, T, A)) -> Self
fn from(components: (T, T, T, A)) -> Self
source§impl<S, T, A> From<(T, T, T, A)> for Alpha<Rgb<S, T>, A>
impl<S, T, A> From<(T, T, T, A)> for Alpha<Rgb<S, T>, A>
source§fn from(components: (T, T, T, A)) -> Self
fn from(components: (T, T, T, A)) -> Self
source§impl<Wp, T, A> From<(T, T, T, A)> for Alpha<Xyz<Wp, T>, A>
impl<Wp, T, A> From<(T, T, T, A)> for Alpha<Xyz<Wp, T>, A>
source§fn from(components: (T, T, T, A)) -> Self
fn from(components: (T, T, T, A)) -> Self
source§impl<Wp, T, A> From<(T, T, T, A)> for Alpha<Yxy<Wp, T>, A>
impl<Wp, T, A> From<(T, T, T, A)> for Alpha<Yxy<Wp, T>, A>
source§fn from(components: (T, T, T, A)) -> Self
fn from(components: (T, T, T, A)) -> Self
source§impl<C> From<Alpha<C, <C as Premultiply>::Scalar>> for PreAlpha<C>where
C: Premultiply,
impl<C> From<Alpha<C, <C as Premultiply>::Scalar>> for PreAlpha<C>where C: Premultiply,
source§impl<C, T, const N: usize> From<Alpha<C, T>> for [T; N]where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<C, T, const N: usize> From<Alpha<C, T>> for [T; N]where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<S, T, V, const N: usize> From<Alpha<Hsl<S, V>, V>> for [Alpha<Hsl<S, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<S, T, V, const N: usize> From<Alpha<Hsl<S, V>, V>> for [Alpha<Hsl<S, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<Alpha<Hsluv<Wp, V>, V>> for [Alpha<Hsluv<Wp, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<Alpha<Hsluv<Wp, V>, V>> for [Alpha<Hsluv<Wp, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<S, T, V, const N: usize> From<Alpha<Hsv<S, V>, V>> for [Alpha<Hsv<S, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<S, T, V, const N: usize> From<Alpha<Hsv<S, V>, V>> for [Alpha<Hsv<S, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<S, T, V, const N: usize> From<Alpha<Hwb<S, V>, V>> for [Alpha<Hwb<S, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<S, T, V, const N: usize> From<Alpha<Hwb<S, V>, V>> for [Alpha<Hwb<S, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<Alpha<Lab<Wp, V>, V>> for [Alpha<Lab<Wp, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<Alpha<Lab<Wp, V>, V>> for [Alpha<Lab<Wp, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<Alpha<Lch<Wp, V>, V>> for [Alpha<Lch<Wp, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<Alpha<Lch<Wp, V>, V>> for [Alpha<Lch<Wp, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<Alpha<Lchuv<Wp, V>, V>> for [Alpha<Lchuv<Wp, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<Alpha<Lchuv<Wp, V>, V>> for [Alpha<Lchuv<Wp, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<S, T, O, P> From<Alpha<Luma<S, T>, T>> for Packed<O, P>where
O: ComponentOrder<Lumaa<S, T>, P>,
impl<S, T, O, P> From<Alpha<Luma<S, T>, T>> for Packed<O, P>where O: ComponentOrder<Lumaa<S, T>, P>,
source§impl<S, T, V, const N: usize> From<Alpha<Luma<S, V>, V>> for [Alpha<Luma<S, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<S, T, V, const N: usize> From<Alpha<Luma<S, V>, V>> for [Alpha<Luma<S, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<Alpha<Luv<Wp, V>, V>> for [Alpha<Luv<Wp, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<Alpha<Luv<Wp, V>, V>> for [Alpha<Luv<Wp, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<T, V, const N: usize> From<Alpha<Okhsl<V>, V>> for [Alpha<Okhsl<T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<T, V, const N: usize> From<Alpha<Okhsl<V>, V>> for [Alpha<Okhsl<T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<T, V, const N: usize> From<Alpha<Okhsv<V>, V>> for [Alpha<Okhsv<T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<T, V, const N: usize> From<Alpha<Okhsv<V>, V>> for [Alpha<Okhsv<T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<T, V, const N: usize> From<Alpha<Okhwb<V>, V>> for [Alpha<Okhwb<T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<T, V, const N: usize> From<Alpha<Okhwb<V>, V>> for [Alpha<Okhwb<T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<T, V, const N: usize> From<Alpha<Oklab<V>, V>> for [Alpha<Oklab<T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<T, V, const N: usize> From<Alpha<Oklab<V>, V>> for [Alpha<Oklab<T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<T, V, const N: usize> From<Alpha<Oklch<V>, V>> for [Alpha<Oklch<T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<T, V, const N: usize> From<Alpha<Oklch<V>, V>> for [Alpha<Oklch<T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<T, U> From<Alpha<Rgb<Linear<Srgb>, T>, T>> for Srgba<U>where
U: FromStimulus<T>,
Srgb: RgbStandard<Space = Srgb> + FromLinear<T, U>,
impl<T, U> From<Alpha<Rgb<Linear<Srgb>, T>, T>> for Srgba<U>where U: FromStimulus<T>, Srgb: RgbStandard<Space = Srgb> + FromLinear<T, U>,
source§impl<S, T, O, P> From<Alpha<Rgb<S, T>, T>> for Packed<O, P>where
O: ComponentOrder<Rgba<S, T>, P>,
impl<S, T, O, P> From<Alpha<Rgb<S, T>, T>> for Packed<O, P>where O: ComponentOrder<Rgba<S, T>, P>,
source§impl<S, T, V, const N: usize> From<Alpha<Rgb<S, V>, V>> for [Alpha<Rgb<S, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<S, T, V, const N: usize> From<Alpha<Rgb<S, V>, V>> for [Alpha<Rgb<S, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<T, U> From<Alpha<Rgb<Srgb, T>, T>> for LinSrgba<U>where
U: FromStimulus<T>,
Srgb: RgbStandard<Space = Srgb> + IntoLinear<U, T>,
impl<T, U> From<Alpha<Rgb<Srgb, T>, T>> for LinSrgba<U>where U: FromStimulus<T>, Srgb: RgbStandard<Space = Srgb> + IntoLinear<U, T>,
source§impl<Wp, T, V, const N: usize> From<Alpha<Xyz<Wp, V>, V>> for [Alpha<Xyz<Wp, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<Alpha<Xyz<Wp, V>, V>> for [Alpha<Xyz<Wp, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<Wp, T, V, const N: usize> From<Alpha<Yxy<Wp, V>, V>> for [Alpha<Yxy<Wp, T>, T>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
impl<Wp, T, V, const N: usize> From<Alpha<Yxy<Wp, V>, V>> for [Alpha<Yxy<Wp, T>, T>; N]where Self: Default, V: IntoScalarArray<N, Scalar = T>,
source§impl<C, T, const N: usize> From<Box<[T; N], Global>> for Box<Alpha<C, T>>where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<C, T, const N: usize> From<Box<[T; N], Global>> for Box<Alpha<C, T>>where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<S, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Hsl<S, T>where
_C: IntoColorUnclamped<Self>,
impl<S, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Hsl<S, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Hsluv<Wp, T>where
_C: IntoColorUnclamped<Self>,
impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Hsluv<Wp, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<S, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Hsv<S, T>where
_C: IntoColorUnclamped<Self>,
impl<S, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Hsv<S, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<S, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Hwb<S, T>where
_C: IntoColorUnclamped<Self>,
impl<S, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Hwb<S, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Lab<Wp, T>where
_C: IntoColorUnclamped<Self>,
impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Lab<Wp, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Lch<Wp, T>where
_C: IntoColorUnclamped<Self>,
impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Lch<Wp, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Lchuv<Wp, T>where
_C: IntoColorUnclamped<Self>,
impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Lchuv<Wp, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<S, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Luma<S, T>where
_C: IntoColorUnclamped<Self>,
impl<S, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Luma<S, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Luv<Wp, T>where
_C: IntoColorUnclamped<Self>,
impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Luv<Wp, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Okhsl<T>where
_C: IntoColorUnclamped<Self>,
impl<T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Okhsl<T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Okhsv<T>where
_C: IntoColorUnclamped<Self>,
impl<T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Okhsv<T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Okhwb<T>where
_C: IntoColorUnclamped<Self>,
impl<T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Okhwb<T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Oklab<T>where
_C: IntoColorUnclamped<Self>,
impl<T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Oklab<T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Oklch<T>where
_C: IntoColorUnclamped<Self>,
impl<T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Oklch<T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<S, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Rgb<S, T>where
_C: IntoColorUnclamped<Self>,
impl<S, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Rgb<S, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Xyz<Wp, T>where
_C: IntoColorUnclamped<Self>,
impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Xyz<Wp, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Yxy<Wp, T>where
_C: IntoColorUnclamped<Self>,
impl<Wp, T, _C, _A> FromColorUnclamped<Alpha<_C, _A>> for Yxy<Wp, T>where _C: IntoColorUnclamped<Self>,
source§fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
fn from_color_unclamped(color: Alpha<_C, _A>) -> Self
source§impl<C1: WithAlpha<T>, C2, T> FromColorUnclamped<C1> for Alpha<C2, T>where
C1::Color: IntoColorUnclamped<C2>,
impl<C1: WithAlpha<T>, C2, T> FromColorUnclamped<C1> for Alpha<C2, T>where C1::Color: IntoColorUnclamped<C2>,
source§fn from_color_unclamped(other: C1) -> Self
fn from_color_unclamped(other: C1) -> Self
source§impl<Tc, Ta, C, A> FromIterator<Alpha<Tc, Ta>> for Alpha<C, A>where
C: Extend<Tc> + FromIterator<Tc>,
A: Extend<Ta> + Default,
impl<Tc, Ta, C, A> FromIterator<Alpha<Tc, Ta>> for Alpha<C, A>where C: Extend<Tc> + FromIterator<Tc>, A: Extend<Ta> + Default,
source§impl<C, T> HasBoolMask for Alpha<C, T>where
C: HasBoolMask,
T: HasBoolMask<Mask = C::Mask>,
impl<C, T> HasBoolMask for Alpha<C, T>where C: HasBoolMask, T: HasBoolMask<Mask = C::Mask>,
§type Mask = <C as HasBoolMask>::Mask
type Mask = <C as HasBoolMask>::Mask
Self
values.source§impl<'a, C, A> IntoIterator for &'a Alpha<C, A>where
&'a C: IntoIterator,
&'a A: IntoIterator,
impl<'a, C, A> IntoIterator for &'a Alpha<C, A>where &'a C: IntoIterator, &'a A: IntoIterator,
§type Item = Alpha<<&'a C as IntoIterator>::Item, <&'a A as IntoIterator>::Item>
type Item = Alpha<<&'a C as IntoIterator>::Item, <&'a A as IntoIterator>::Item>
§type IntoIter = Iter<<&'a C as IntoIterator>::IntoIter, <&'a A as IntoIterator>::IntoIter>
type IntoIter = Iter<<&'a C as IntoIterator>::IntoIter, <&'a A as IntoIterator>::IntoIter>
source§impl<'a, C, A> IntoIterator for &'a mut Alpha<C, A>where
&'a mut C: IntoIterator,
&'a mut A: IntoIterator,
impl<'a, C, A> IntoIterator for &'a mut Alpha<C, A>where &'a mut C: IntoIterator, &'a mut A: IntoIterator,
§type Item = Alpha<<&'a mut C as IntoIterator>::Item, <&'a mut A as IntoIterator>::Item>
type Item = Alpha<<&'a mut C as IntoIterator>::Item, <&'a mut A as IntoIterator>::Item>
§type IntoIter = Iter<<&'a mut C as IntoIterator>::IntoIter, <&'a mut A as IntoIterator>::IntoIter>
type IntoIter = Iter<<&'a mut C as IntoIterator>::IntoIter, <&'a mut A as IntoIterator>::IntoIter>
source§impl<C, A> IntoIterator for Alpha<C, A>where
C: IntoIterator,
A: IntoIterator,
impl<C, A> IntoIterator for Alpha<C, A>where C: IntoIterator, A: IntoIterator,
§type Item = Alpha<<C as IntoIterator>::Item, <A as IntoIterator>::Item>
type Item = Alpha<<C as IntoIterator>::Item, <A as IntoIterator>::Item>
§type IntoIter = Iter<<C as IntoIterator>::IntoIter, <A as IntoIterator>::IntoIter>
type IntoIter = Iter<<C as IntoIterator>::IntoIter, <A as IntoIterator>::IntoIter>
source§impl<C, T> IsWithinBounds for Alpha<C, T>where
C: IsWithinBounds,
T: Stimulus + PartialCmp + IsWithinBounds<Mask = C::Mask>,
C::Mask: BitAnd<Output = C::Mask>,
impl<C, T> IsWithinBounds for Alpha<C, T>where C: IsWithinBounds, T: Stimulus + PartialCmp + IsWithinBounds<Mask = C::Mask>, C::Mask: BitAnd<Output = C::Mask>,
source§fn is_within_bounds(&self) -> C::Mask
fn is_within_bounds(&self) -> C::Mask
source§impl<C: Lighten> Lighten for Alpha<C, C::Scalar>
impl<C: Lighten> Lighten for Alpha<C, C::Scalar>
source§impl<C: LightenAssign> LightenAssign for Alpha<C, C::Scalar>
impl<C: LightenAssign> LightenAssign for Alpha<C, C::Scalar>
§type Scalar = <C as LightenAssign>::Scalar
type Scalar = <C as LightenAssign>::Scalar
source§fn lighten_assign(&mut self, factor: C::Scalar)
fn lighten_assign(&mut self, factor: C::Scalar)
source§fn lighten_fixed_assign(&mut self, amount: C::Scalar)
fn lighten_fixed_assign(&mut self, amount: C::Scalar)
source§impl<C> Mix for Alpha<C, C::Scalar>where
C: Mix,
C::Scalar: Zero + One + Clamp + Arithmetics + Clone,
impl<C> Mix for Alpha<C, C::Scalar>where C: Mix, C::Scalar: Zero + One + Clamp + Arithmetics + Clone,
source§impl<C> MixAssign for Alpha<C, C::Scalar>where
C: MixAssign,
C::Scalar: Zero + One + Clamp + Arithmetics + AddAssign + Clone,
impl<C> MixAssign for Alpha<C, C::Scalar>where C: MixAssign, C::Scalar: Zero + One + Clamp + Arithmetics + AddAssign + Clone,
source§impl<C, T> MulAssign<Alpha<C, T>> for Alpha<C, T>where
C: MulAssign,
T: MulAssign,
impl<C, T> MulAssign<Alpha<C, T>> for Alpha<C, T>where C: MulAssign, T: MulAssign,
source§fn mul_assign(&mut self, other: Alpha<C, T>)
fn mul_assign(&mut self, other: Alpha<C, T>)
*=
operation. Read moresource§impl<T, C> MulAssign<T> for Alpha<C, T>where
T: MulAssign + Clone,
C: MulAssign<T>,
impl<T, C> MulAssign<T> for Alpha<C, T>where T: MulAssign + Clone, C: MulAssign<T>,
source§fn mul_assign(&mut self, c: T)
fn mul_assign(&mut self, c: T)
*=
operation. Read moresource§impl<C, T> PartialEq<Alpha<C, T>> for Alpha<C, T>where
T: PartialEq,
C: PartialEq,
impl<C, T> PartialEq<Alpha<C, T>> for Alpha<C, T>where T: PartialEq, C: PartialEq,
source§impl<C, T> RelativeEq<Alpha<C, T>> for Alpha<C, T>where
C: RelativeEq<Epsilon = T::Epsilon>,
T: RelativeEq,
T::Epsilon: Clone,
impl<C, T> RelativeEq<Alpha<C, T>> for Alpha<C, T>where C: RelativeEq<Epsilon = T::Epsilon>, T: RelativeEq, T::Epsilon: Clone,
source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
source§fn relative_eq(
&self,
other: &Alpha<C, T>,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_eq( &self, other: &Alpha<C, T>, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool
source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool
RelativeEq::relative_eq
.source§impl<C, T> SampleUniform for Alpha<C, T>where
T: Clone + SampleUniform,
C: Clone + SampleUniform,
impl<C, T> SampleUniform for Alpha<C, T>where T: Clone + SampleUniform, C: Clone + SampleUniform,
§type Sampler = UniformAlpha<C, T>
type Sampler = UniformAlpha<C, T>
UniformSampler
implementation supporting type X
.source§impl<C: Saturate> Saturate for Alpha<C, C::Scalar>
impl<C: Saturate> Saturate for Alpha<C, C::Scalar>
source§impl<C: SaturateAssign> SaturateAssign for Alpha<C, C::Scalar>
impl<C: SaturateAssign> SaturateAssign for Alpha<C, C::Scalar>
§type Scalar = <C as SaturateAssign>::Scalar
type Scalar = <C as SaturateAssign>::Scalar
source§fn saturate_assign(&mut self, factor: C::Scalar)
fn saturate_assign(&mut self, factor: C::Scalar)
factor
, a value
ranging from 0.0
to 1.0
. Read moresource§fn saturate_fixed_assign(&mut self, amount: C::Scalar)
fn saturate_fixed_assign(&mut self, amount: C::Scalar)
source§impl<C, T> SaturatingAdd<Alpha<C, T>> for Alpha<C, T>where
C: SaturatingAdd,
T: SaturatingAdd,
impl<C, T> SaturatingAdd<Alpha<C, T>> for Alpha<C, T>where C: SaturatingAdd, T: SaturatingAdd,
§type Output = Alpha<<C as SaturatingAdd<C>>::Output, <T as SaturatingAdd<T>>::Output>
type Output = Alpha<<C as SaturatingAdd<C>>::Output, <T as SaturatingAdd<T>>::Output>
source§fn saturating_add(self, other: Alpha<C, T>) -> Self::Output
fn saturating_add(self, other: Alpha<C, T>) -> Self::Output
self
and other
, but saturates instead of overflowing.source§impl<T, C> SaturatingAdd<T> for Alpha<C, T>where
T: SaturatingAdd + Clone,
C: SaturatingAdd<T>,
impl<T, C> SaturatingAdd<T> for Alpha<C, T>where T: SaturatingAdd + Clone, C: SaturatingAdd<T>,
§type Output = Alpha<<C as SaturatingAdd<T>>::Output, <T as SaturatingAdd<T>>::Output>
type Output = Alpha<<C as SaturatingAdd<T>>::Output, <T as SaturatingAdd<T>>::Output>
source§fn saturating_add(self, c: T) -> Self::Output
fn saturating_add(self, c: T) -> Self::Output
self
and other
, but saturates instead of overflowing.source§impl<C, T> SaturatingSub<Alpha<C, T>> for Alpha<C, T>where
C: SaturatingSub,
T: SaturatingSub,
impl<C, T> SaturatingSub<Alpha<C, T>> for Alpha<C, T>where C: SaturatingSub, T: SaturatingSub,
§type Output = Alpha<<C as SaturatingSub<C>>::Output, <T as SaturatingSub<T>>::Output>
type Output = Alpha<<C as SaturatingSub<C>>::Output, <T as SaturatingSub<T>>::Output>
source§fn saturating_sub(self, other: Alpha<C, T>) -> Self::Output
fn saturating_sub(self, other: Alpha<C, T>) -> Self::Output
self
and other
, but saturates instead of overflowing.source§impl<T, C> SaturatingSub<T> for Alpha<C, T>where
T: SaturatingSub + Clone,
C: SaturatingSub<T>,
impl<T, C> SaturatingSub<T> for Alpha<C, T>where T: SaturatingSub + Clone, C: SaturatingSub<T>,
§type Output = Alpha<<C as SaturatingSub<T>>::Output, <T as SaturatingSub<T>>::Output>
type Output = Alpha<<C as SaturatingSub<T>>::Output, <T as SaturatingSub<T>>::Output>
source§fn saturating_sub(self, c: T) -> Self::Output
fn saturating_sub(self, c: T) -> Self::Output
self
and other
, but saturates instead of overflowing.source§impl<C, T> ShiftHueAssign for Alpha<C, T>where
C: ShiftHueAssign,
impl<C, T> ShiftHueAssign for Alpha<C, T>where C: ShiftHueAssign,
§type Scalar = <C as ShiftHueAssign>::Scalar
type Scalar = <C as ShiftHueAssign>::Scalar
source§fn shift_hue_assign(&mut self, amount: Self::Scalar)
fn shift_hue_assign(&mut self, amount: Self::Scalar)
amount
.source§impl<C, T> SubAssign<Alpha<C, T>> for Alpha<C, T>where
C: SubAssign,
T: SubAssign,
impl<C, T> SubAssign<Alpha<C, T>> for Alpha<C, T>where C: SubAssign, T: SubAssign,
source§fn sub_assign(&mut self, other: Alpha<C, T>)
fn sub_assign(&mut self, other: Alpha<C, T>)
-=
operation. Read moresource§impl<T, C> SubAssign<T> for Alpha<C, T>where
T: SubAssign + Clone,
C: SubAssign<T>,
impl<T, C> SubAssign<T> for Alpha<C, T>where T: SubAssign + Clone, C: SubAssign<T>,
source§fn sub_assign(&mut self, c: T)
fn sub_assign(&mut self, c: T)
-=
operation. Read moresource§impl<'a, C, T, const N: usize> TryFrom<&'a [T]> for &'a Alpha<C, T>where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<'a, C, T, const N: usize> TryFrom<&'a [T]> for &'a Alpha<C, T>where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<'a, C, T, const N: usize> TryFrom<&'a mut [T]> for &'a mut Alpha<C, T>where
Alpha<C, T>: ArrayCast<Array = [T; N]>,
impl<'a, C, T, const N: usize> TryFrom<&'a mut [T]> for &'a mut Alpha<C, T>where Alpha<C, T>: ArrayCast<Array = [T; N]>,
source§impl<C, T> UlpsEq<Alpha<C, T>> for Alpha<C, T>where
C: UlpsEq<Epsilon = T::Epsilon>,
T: UlpsEq,
T::Epsilon: Clone,
impl<C, T> UlpsEq<Alpha<C, T>> for Alpha<C, T>where C: UlpsEq<Epsilon = T::Epsilon>, T: UlpsEq, T::Epsilon: Clone,
source§impl<C, A> WithAlpha<A> for Alpha<C, A>
impl<C, A> WithAlpha<A> for Alpha<C, A>
source§fn with_alpha(self, alpha: A) -> Self::WithAlpha
fn with_alpha(self, alpha: A) -> Self::WithAlpha
Self
already has a transparency, it is
overwritten. Read moresource§fn without_alpha(self) -> Self::Color
fn without_alpha(self) -> Self::Color
Self::Color
has
an internal transparency field, that field will be set to
A::max_intensity()
to make it opaque. Read moreimpl<C: Copy, T: Copy> Copy for Alpha<C, T>
impl<C, T> Eq for Alpha<C, T>where T: Eq, C: Eq,
impl<C, T> Pod for Alpha<C, T>where T: Pod, C: Pod + ArrayCast,
Auto Trait Implementations§
impl<C, T> RefUnwindSafe for Alpha<C, T>where C: RefUnwindSafe, T: RefUnwindSafe,
impl<C, T> Send for Alpha<C, T>where C: Send, T: Send,
impl<C, T> Sync for Alpha<C, T>where C: Sync, T: Sync,
impl<C, T> Unpin for Alpha<C, T>where C: Unpin, T: Unpin,
impl<C, T> UnwindSafe for Alpha<C, T>where C: UnwindSafe, T: UnwindSafe,
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for Dwhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
S: IntoColorUnclamped<Xyz<Swp, T>>,
D: FromColorUnclamped<Xyz<Dwp, T>>,
impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for Dwhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, S: IntoColorUnclamped<Xyz<Swp, T>>, D: FromColorUnclamped<Xyz<Dwp, T>>,
source§fn adapt_from_using<M>(color: S, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_from_using<M>(color: S, method: M) -> Dwhere M: TransformMatrix<T>,
source§fn adapt_from(color: S) -> Self
fn adapt_from(color: S) -> Self
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere M: TransformMatrix<T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere C: IntoArrays<T>,
source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere C: FromArrays<T>,
source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere C: IntoComponents<T>,
source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.source§impl<T, U> FromColor<T> for Uwhere
U: FromColorUnclamped<T> + Clamp,
impl<T, U> FromColor<T> for Uwhere U: FromColorUnclamped<T> + Clamp,
source§fn from_color(t: T) -> U
fn from_color(t: T) -> U
source§impl<T, U> FromColorMut<U> for Twhere
T: FromColor<U> + ArrayCast + Clone,
U: FromColor<T> + ArrayCast<Array = <T as ArrayCast>::Array> + Clone,
impl<T, U> FromColorMut<U> for Twhere T: FromColor<U> + ArrayCast + Clone, U: FromColor<T> + ArrayCast<Array = <T as ArrayCast>::Array> + Clone,
source§fn from_color_mut(color: &mut U) -> FromColorMutGuard<'_, T, U>
fn from_color_mut(color: &mut U) -> FromColorMutGuard<'_, T, U>
source§impl<T, U> FromColorUnclampedMut<U> for Twhere
T: FromColorUnclamped<U> + ArrayCast + Clone,
U: FromColorUnclamped<T> + ArrayCast<Array = <T as ArrayCast>::Array> + Clone,
impl<T, U> FromColorUnclampedMut<U> for Twhere T: FromColorUnclamped<U> + ArrayCast + Clone, U: FromColorUnclamped<T> + ArrayCast<Array = <T as ArrayCast>::Array> + Clone,
source§fn from_color_unclamped_mut(
color: &mut U
) -> FromColorUnclampedMutGuard<'_, T, U>
fn from_color_unclamped_mut( color: &mut U ) -> FromColorUnclampedMutGuard<'_, T, U>
source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere U: IntoStimulus<T>,
source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere U: FromAngle<T>,
source§fn into_angle(self) -> U
fn into_angle(self) -> U
T
.source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
source§impl<T, U> IntoColorMut<T> for Uwhere
T: FromColorMut<U> + ?Sized,
U: FromColorMut<T> + ?Sized,
impl<T, U> IntoColorMut<T> for Uwhere T: FromColorMut<U> + ?Sized, U: FromColorMut<T> + ?Sized,
source§fn into_color_mut(&mut self) -> FromColorMutGuard<'_, T, U>
fn into_color_mut(&mut self) -> FromColorMutGuard<'_, T, U>
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
source§impl<T, U> IntoColorUnclampedMut<T> for Uwhere
T: FromColorUnclampedMut<U> + ?Sized,
U: FromColorUnclampedMut<T> + ?Sized,
impl<T, U> IntoColorUnclampedMut<T> for Uwhere T: FromColorUnclampedMut<U> + ?Sized, U: FromColorUnclampedMut<T> + ?Sized,
source§fn into_color_unclamped_mut(&mut self) -> FromColorUnclampedMutGuard<'_, T, U>
fn into_color_unclamped_mut(&mut self) -> FromColorUnclampedMutGuard<'_, T, U>
source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.source§impl<Borrowed> SampleBorrow<Borrowed> for Borrowedwhere
Borrowed: SampleUniform,
impl<Borrowed> SampleBorrow<Borrowed> for Borrowedwhere Borrowed: SampleUniform,
source§fn borrow(&self) -> &Borrowed
fn borrow(&self) -> &Borrowed
Borrow::borrow
source§impl<'a, T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<'a, T, C> TryComponentsInto<C> for Twhere C: TryFromComponents<T>,
§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
source§impl<T, U> TryFromColor<T> for Uwhere
U: FromColorUnclamped<T> + IsWithinBounds<Mask = bool>,
impl<T, U> TryFromColor<T> for Uwhere U: FromColorUnclamped<T> + IsWithinBounds<Mask = bool>,
source§fn try_from_color(t: T) -> Result<U, OutOfBounds<U>>
fn try_from_color(t: T) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read moresource§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more