#[repr(C)]pub struct PreAlpha<C: Premultiply> {
pub color: C,
pub alpha: C::Scalar,
}
Expand description
Premultiplied alpha wrapper.
Premultiplied, or alpha masked, or associated alpha colors have had their component values multiplied with their alpha value. They are commonly used in composition algorithms and as output from computer generated graphics. It may also be preferred when interpolating between colors and in other image manipulation operations, such as blurring or resizing images.
use palette::{LinSrgb, LinSrgba};
use palette::blend::{Blend, PreAlpha};
let a = PreAlpha::from(LinSrgba::new(0.4, 0.5, 0.5, 0.3));
let b = PreAlpha::from(LinSrgba::new(0.3, 0.8, 0.4, 0.4));
let c = PreAlpha::from(LinSrgba::new(0.7, 0.1, 0.8, 0.8));
let res: LinSrgba = a.screen(b).overlay(c).into();
Note that converting to and from premultiplied alpha will cause the alpha component to be clamped to [0.0, 1.0], and fully transparent colors will become black.
Fields§
§color: C
The premultiplied color components (original.color * original.alpha
).
alpha: C::Scalar
The transparency component. 0.0 is fully transparent and 1.0 is fully opaque.
Implementations§
source§impl<C> PreAlpha<C>where
C: Premultiply,
impl<C> PreAlpha<C>where
C: Premultiply,
Trait Implementations§
source§impl<C, T> AbsDiffEq for PreAlpha<C>
impl<C, T> AbsDiffEq for PreAlpha<C>
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§fn abs_diff_eq(&self, other: &PreAlpha<C>, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &PreAlpha<C>, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq
.source§impl<C> AddAssign<f32> for PreAlpha<C>
impl<C> AddAssign<f32> for PreAlpha<C>
source§fn add_assign(&mut self, c: f32)
fn add_assign(&mut self, c: f32)
Performs the
+=
operation. Read moresource§impl<C> AddAssign<f64> for PreAlpha<C>
impl<C> AddAssign<f64> for PreAlpha<C>
source§fn add_assign(&mut self, c: f64)
fn add_assign(&mut self, c: f64)
Performs the
+=
operation. Read moresource§impl<C> AddAssign for PreAlpha<C>
impl<C> AddAssign for PreAlpha<C>
source§fn add_assign(&mut self, other: PreAlpha<C>)
fn add_assign(&mut self, other: PreAlpha<C>)
Performs the
+=
operation. Read moresource§impl<C: Premultiply, const N: usize> AsMut<[<C as Premultiply>::Scalar]> for PreAlpha<C>
impl<C: Premultiply, const N: usize> AsMut<[<C as Premultiply>::Scalar]> for PreAlpha<C>
source§impl<C: Premultiply, const N: usize> AsMut<[<C as Premultiply>::Scalar; N]> for PreAlpha<C>
impl<C: Premultiply, const N: usize> AsMut<[<C as Premultiply>::Scalar; N]> for PreAlpha<C>
source§impl<C: Premultiply, const N: usize> AsRef<[<C as Premultiply>::Scalar]> for PreAlpha<C>
impl<C: Premultiply, const N: usize> AsRef<[<C as Premultiply>::Scalar]> for PreAlpha<C>
source§impl<C: Premultiply, const N: usize> AsRef<[<C as Premultiply>::Scalar; N]> for PreAlpha<C>
impl<C: Premultiply, const N: usize> AsRef<[<C as Premultiply>::Scalar; N]> for PreAlpha<C>
source§impl<C, T, const N: usize> Blend for PreAlpha<C>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 PreAlpha<C>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
Multiply
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
Make a color which is at least as light as
self
or other
.source§fn overlay(self, other: Self) -> Self
fn overlay(self, other: Self) -> Self
Multiply
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
Lighten
other
to reflect self
. Results in other
if self
is
black.source§fn burn(self, other: Self) -> Self
fn burn(self, other: Self) -> Self
Darken
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
Multiply
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
Lighten
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
Return the absolute difference between
self
and other
. It’s
basically abs(self - other)
, but regulated by the alpha component.source§impl<C> BlendWith for PreAlpha<C>where
C: Premultiply,
impl<C> BlendWith for PreAlpha<C>where
C: Premultiply,
source§fn blend_with<F>(self, other: Self, blend_function: F) -> Selfwhere
F: BlendFunction<Self::Color>,
fn blend_with<F>(self, other: Self, blend_function: F) -> Selfwhere
F: BlendFunction<Self::Color>,
Blend self, as the source color, with
destination
, using
blend_function
. Anything that implements BlendFunction
is
acceptable, including functions and closures. Read moresource§impl<C, T, const N: usize> Compose for PreAlpha<C>where
C: ArrayCast<Array = [T; N]> + Premultiply<Scalar = T>,
T: Real + Zero + One + Arithmetics + Clamp + Clone,
impl<C, T, const N: usize> Compose for PreAlpha<C>where
C: ArrayCast<Array = [T; N]> + Premultiply<Scalar = T>,
T: Real + Zero + One + Arithmetics + Clamp + Clone,
source§fn over(self, other: Self) -> Self
fn over(self, other: Self) -> Self
Place
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
Results in the parts of
self
that overlaps the visible parts of
other
.source§impl<C: Premultiply> Deref for PreAlpha<C>
impl<C: Premultiply> Deref for PreAlpha<C>
source§impl<C: Premultiply> DerefMut for PreAlpha<C>
impl<C: Premultiply> DerefMut for PreAlpha<C>
source§impl<'de, C> Deserialize<'de> for PreAlpha<C>
impl<'de, C> Deserialize<'de> for PreAlpha<C>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<C> DivAssign<f32> for PreAlpha<C>
impl<C> DivAssign<f32> for PreAlpha<C>
source§fn div_assign(&mut self, c: f32)
fn div_assign(&mut self, c: f32)
Performs the
/=
operation. Read moresource§impl<C> DivAssign<f64> for PreAlpha<C>
impl<C> DivAssign<f64> for PreAlpha<C>
source§fn div_assign(&mut self, c: f64)
fn div_assign(&mut self, c: f64)
Performs the
/=
operation. Read moresource§impl<C> DivAssign for PreAlpha<C>
impl<C> DivAssign for PreAlpha<C>
source§fn div_assign(&mut self, other: PreAlpha<C>)
fn div_assign(&mut self, other: PreAlpha<C>)
Performs the
/=
operation. Read moresource§impl<'a, C: Premultiply, const N: usize> From<&'a [<C as Premultiply>::Scalar; N]> for &'a PreAlpha<C>
impl<'a, C: Premultiply, const N: usize> From<&'a [<C as Premultiply>::Scalar; N]> for &'a PreAlpha<C>
source§impl<'a, C: Premultiply, const N: usize> From<&'a mut [<C as Premultiply>::Scalar; N]> for &'a mut PreAlpha<C>
impl<'a, C: Premultiply, const N: usize> From<&'a mut [<C as Premultiply>::Scalar; N]> for &'a mut PreAlpha<C>
source§impl<'a, C: Premultiply, const N: usize> From<&'a mut PreAlpha<C>> for &'a mut [C::Scalar; N]
impl<'a, C: Premultiply, const N: usize> From<&'a mut PreAlpha<C>> for &'a mut [C::Scalar; N]
source§impl<C: Premultiply, const N: usize> From<[<C as Premultiply>::Scalar; N]> for PreAlpha<C>
impl<C: Premultiply, const N: usize> From<[<C as Premultiply>::Scalar; N]> for PreAlpha<C>
source§impl<T, V, const N: usize> From<[PreAlpha<Cam16UcsJab<T>>; N]> for PreAlpha<Cam16UcsJab<V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Cam16UcsJab<T>: Premultiply<Scalar = T>,
Cam16UcsJab<V>: Premultiply<Scalar = V>,
impl<T, V, const N: usize> From<[PreAlpha<Cam16UcsJab<T>>; N]> for PreAlpha<Cam16UcsJab<V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Cam16UcsJab<T>: Premultiply<Scalar = T>,
Cam16UcsJab<V>: Premultiply<Scalar = V>,
source§impl<Wp, T, V, const N: usize> From<[PreAlpha<Lab<Wp, T>>; N]> for PreAlpha<Lab<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Lab<Wp, T>: Premultiply<Scalar = T>,
Lab<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<[PreAlpha<Lab<Wp, T>>; N]> for PreAlpha<Lab<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Lab<Wp, T>: Premultiply<Scalar = T>,
Lab<Wp, V>: Premultiply<Scalar = V>,
source§impl<S, T, V, const N: usize> From<[PreAlpha<Luma<S, T>>; N]> for PreAlpha<Luma<S, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Luma<S, T>: Premultiply<Scalar = T>,
Luma<S, V>: Premultiply<Scalar = V>,
impl<S, T, V, const N: usize> From<[PreAlpha<Luma<S, T>>; N]> for PreAlpha<Luma<S, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Luma<S, T>: Premultiply<Scalar = T>,
Luma<S, V>: Premultiply<Scalar = V>,
source§impl<Wp, T, V, const N: usize> From<[PreAlpha<Luv<Wp, T>>; N]> for PreAlpha<Luv<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Luv<Wp, T>: Premultiply<Scalar = T>,
Luv<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<[PreAlpha<Luv<Wp, T>>; N]> for PreAlpha<Luv<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Luv<Wp, T>: Premultiply<Scalar = T>,
Luv<Wp, V>: Premultiply<Scalar = V>,
source§impl<T, V, const N: usize> From<[PreAlpha<Oklab<T>>; N]> for PreAlpha<Oklab<V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Oklab<T>: Premultiply<Scalar = T>,
Oklab<V>: Premultiply<Scalar = V>,
impl<T, V, const N: usize> From<[PreAlpha<Oklab<T>>; N]> for PreAlpha<Oklab<V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Oklab<T>: Premultiply<Scalar = T>,
Oklab<V>: Premultiply<Scalar = V>,
source§impl<S, T, V, const N: usize> From<[PreAlpha<Rgb<S, T>>; N]> for PreAlpha<Rgb<S, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Rgb<S, T>: Premultiply<Scalar = T>,
Rgb<S, V>: Premultiply<Scalar = V>,
impl<S, T, V, const N: usize> From<[PreAlpha<Rgb<S, T>>; N]> for PreAlpha<Rgb<S, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Rgb<S, T>: Premultiply<Scalar = T>,
Rgb<S, V>: Premultiply<Scalar = V>,
source§impl<Wp, T, V, const N: usize> From<[PreAlpha<Xyz<Wp, T>>; N]> for PreAlpha<Xyz<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Xyz<Wp, T>: Premultiply<Scalar = T>,
Xyz<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<[PreAlpha<Xyz<Wp, T>>; N]> for PreAlpha<Xyz<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Xyz<Wp, T>: Premultiply<Scalar = T>,
Xyz<Wp, V>: Premultiply<Scalar = V>,
source§impl<Wp, T, V, const N: usize> From<[PreAlpha<Yxy<Wp, T>>; N]> for PreAlpha<Yxy<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Yxy<Wp, T>: Premultiply<Scalar = T>,
Yxy<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<[PreAlpha<Yxy<Wp, T>>; N]> for PreAlpha<Yxy<Wp, V>>where
[T; N]: Default,
V: FromScalarArray<N, Scalar = T>,
Yxy<Wp, T>: Premultiply<Scalar = T>,
Yxy<Wp, V>: Premultiply<Scalar = V>,
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: Premultiply, const N: usize> From<Box<[<C as Premultiply>::Scalar; N]>> for Box<PreAlpha<C>>
impl<C: Premultiply, const N: usize> From<Box<[<C as Premultiply>::Scalar; N]>> for Box<PreAlpha<C>>
source§impl<T> From<PreAlpha<Cam16UcsJab<T>>> for Cam16UcsJab<T>where
Self: Premultiply<Scalar = T>,
impl<T> From<PreAlpha<Cam16UcsJab<T>>> for Cam16UcsJab<T>where
Self: Premultiply<Scalar = T>,
source§impl<T, V, const N: usize> From<PreAlpha<Cam16UcsJab<V>>> for [PreAlpha<Cam16UcsJab<T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Cam16UcsJab<T>: Premultiply<Scalar = T>,
Cam16UcsJab<V>: Premultiply<Scalar = V>,
impl<T, V, const N: usize> From<PreAlpha<Cam16UcsJab<V>>> for [PreAlpha<Cam16UcsJab<T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Cam16UcsJab<T>: Premultiply<Scalar = T>,
Cam16UcsJab<V>: Premultiply<Scalar = V>,
source§fn from(color: PreAlpha<Cam16UcsJab<V>>) -> Self
fn from(color: PreAlpha<Cam16UcsJab<V>>) -> Self
Converts to this type from the input type.
source§impl<Wp, T, V, const N: usize> From<PreAlpha<Lab<Wp, V>>> for [PreAlpha<Lab<Wp, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Lab<Wp, T>: Premultiply<Scalar = T>,
Lab<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<PreAlpha<Lab<Wp, V>>> for [PreAlpha<Lab<Wp, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Lab<Wp, T>: Premultiply<Scalar = T>,
Lab<Wp, V>: Premultiply<Scalar = V>,
source§impl<S, T, V, const N: usize> From<PreAlpha<Luma<S, V>>> for [PreAlpha<Luma<S, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Luma<S, T>: Premultiply<Scalar = T>,
Luma<S, V>: Premultiply<Scalar = V>,
impl<S, T, V, const N: usize> From<PreAlpha<Luma<S, V>>> for [PreAlpha<Luma<S, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Luma<S, T>: Premultiply<Scalar = T>,
Luma<S, V>: Premultiply<Scalar = V>,
source§impl<Wp, T, V, const N: usize> From<PreAlpha<Luv<Wp, V>>> for [PreAlpha<Luv<Wp, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Luv<Wp, T>: Premultiply<Scalar = T>,
Luv<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<PreAlpha<Luv<Wp, V>>> for [PreAlpha<Luv<Wp, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Luv<Wp, T>: Premultiply<Scalar = T>,
Luv<Wp, V>: Premultiply<Scalar = V>,
source§impl<T, V, const N: usize> From<PreAlpha<Oklab<V>>> for [PreAlpha<Oklab<T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Oklab<T>: Premultiply<Scalar = T>,
Oklab<V>: Premultiply<Scalar = V>,
impl<T, V, const N: usize> From<PreAlpha<Oklab<V>>> for [PreAlpha<Oklab<T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Oklab<T>: Premultiply<Scalar = T>,
Oklab<V>: Premultiply<Scalar = V>,
source§impl<S, T, V, const N: usize> From<PreAlpha<Rgb<S, V>>> for [PreAlpha<Rgb<S, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Rgb<S, T>: Premultiply<Scalar = T>,
Rgb<S, V>: Premultiply<Scalar = V>,
impl<S, T, V, const N: usize> From<PreAlpha<Rgb<S, V>>> for [PreAlpha<Rgb<S, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Rgb<S, T>: Premultiply<Scalar = T>,
Rgb<S, V>: Premultiply<Scalar = V>,
source§impl<Wp, T, V, const N: usize> From<PreAlpha<Xyz<Wp, V>>> for [PreAlpha<Xyz<Wp, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Xyz<Wp, T>: Premultiply<Scalar = T>,
Xyz<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<PreAlpha<Xyz<Wp, V>>> for [PreAlpha<Xyz<Wp, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Xyz<Wp, T>: Premultiply<Scalar = T>,
Xyz<Wp, V>: Premultiply<Scalar = V>,
source§impl<Wp, T, V, const N: usize> From<PreAlpha<Yxy<Wp, V>>> for [PreAlpha<Yxy<Wp, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Yxy<Wp, T>: Premultiply<Scalar = T>,
Yxy<Wp, V>: Premultiply<Scalar = V>,
impl<Wp, T, V, const N: usize> From<PreAlpha<Yxy<Wp, V>>> for [PreAlpha<Yxy<Wp, T>>; N]where
Self: Default,
V: IntoScalarArray<N, Scalar = T>,
Yxy<Wp, T>: Premultiply<Scalar = T>,
Yxy<Wp, V>: Premultiply<Scalar = V>,
source§impl<C, T> Mix for PreAlpha<C>where
C: Mix<Scalar = T> + Premultiply<Scalar = T>,
T: Real + Zero + One + Clamp + Arithmetics + Clone,
impl<C, T> Mix for PreAlpha<C>where
C: Mix<Scalar = T> + Premultiply<Scalar = T>,
T: Real + Zero + One + Clamp + Arithmetics + Clone,
source§impl<C, T> MixAssign for PreAlpha<C>where
C: MixAssign<Scalar = T> + Premultiply<Scalar = T>,
T: Real + Zero + One + Clamp + Arithmetics + AddAssign + Clone,
impl<C, T> MixAssign for PreAlpha<C>where
C: MixAssign<Scalar = T> + Premultiply<Scalar = T>,
T: Real + Zero + One + Clamp + Arithmetics + AddAssign + Clone,
source§impl<C> MulAssign<f32> for PreAlpha<C>
impl<C> MulAssign<f32> for PreAlpha<C>
source§fn mul_assign(&mut self, c: f32)
fn mul_assign(&mut self, c: f32)
Performs the
*=
operation. Read moresource§impl<C> MulAssign<f64> for PreAlpha<C>
impl<C> MulAssign<f64> for PreAlpha<C>
source§fn mul_assign(&mut self, c: f64)
fn mul_assign(&mut self, c: f64)
Performs the
*=
operation. Read moresource§impl<C> MulAssign for PreAlpha<C>
impl<C> MulAssign for PreAlpha<C>
source§fn mul_assign(&mut self, other: PreAlpha<C>)
fn mul_assign(&mut self, other: PreAlpha<C>)
Performs the
*=
operation. Read moresource§impl<C, T> RelativeEq for PreAlpha<C>where
C: RelativeEq<Epsilon = T::Epsilon> + Premultiply<Scalar = T>,
T: RelativeEq,
T::Epsilon: Clone,
impl<C, T> RelativeEq for PreAlpha<C>where
C: RelativeEq<Epsilon = T::Epsilon> + Premultiply<Scalar = T>,
T: RelativeEq,
T::Epsilon: Clone,
source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§fn relative_eq(
&self,
other: &PreAlpha<C>,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &PreAlpha<C>, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
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
The inverse of
RelativeEq::relative_eq
.source§impl<C> SubAssign<f32> for PreAlpha<C>
impl<C> SubAssign<f32> for PreAlpha<C>
source§fn sub_assign(&mut self, c: f32)
fn sub_assign(&mut self, c: f32)
Performs the
-=
operation. Read moresource§impl<C> SubAssign<f64> for PreAlpha<C>
impl<C> SubAssign<f64> for PreAlpha<C>
source§fn sub_assign(&mut self, c: f64)
fn sub_assign(&mut self, c: f64)
Performs the
-=
operation. Read moresource§impl<C> SubAssign for PreAlpha<C>
impl<C> SubAssign for PreAlpha<C>
source§fn sub_assign(&mut self, other: PreAlpha<C>)
fn sub_assign(&mut self, other: PreAlpha<C>)
Performs the
-=
operation. Read moresource§impl<'a, C: Premultiply, const N: usize> TryFrom<&'a [<C as Premultiply>::Scalar]> for &'a PreAlpha<C>
impl<'a, C: Premultiply, const N: usize> TryFrom<&'a [<C as Premultiply>::Scalar]> for &'a PreAlpha<C>
source§impl<'a, C: Premultiply, const N: usize> TryFrom<&'a mut [<C as Premultiply>::Scalar]> for &'a mut PreAlpha<C>
impl<'a, C: Premultiply, const N: usize> TryFrom<&'a mut [<C as Premultiply>::Scalar]> for &'a mut PreAlpha<C>
source§impl<C, T> UlpsEq for PreAlpha<C>
impl<C, T> UlpsEq for PreAlpha<C>
impl<C: Copy + Premultiply> Copy for PreAlpha<C>
impl<C> Eq for PreAlpha<C>
Auto Trait Implementations§
impl<C> Freeze for PreAlpha<C>
impl<C> RefUnwindSafe for PreAlpha<C>
impl<C> Send for PreAlpha<C>
impl<C> Sync for PreAlpha<C>
impl<C> Unpin for PreAlpha<C>
impl<C> UnwindSafe for PreAlpha<C>
Blanket Implementations§
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>,
Convert the source color to the destination color using the specified
method.
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default.
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
Cast a collection of colors into a collection of arrays.
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
Cast this collection of arrays into a collection of colors.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
The number type that’s used in
parameters
when converting.source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
Converts
self
into C
, using the provided parameters.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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
Cast a collection of colors into a collection of color components.
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
Performs a conversion from
angle
.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
Converts
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
Performs a conversion into
T
.source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
The number type that’s used in
parameters
when converting.source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
Converts
self
into C
, using the provided parameters.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
Convert into T with values clamped to the color defined bounds Read more
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
Convert into T. The resulting color might be invalid in its color space Read more
source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
Converts
self
into T
, while performing the appropriate scaling,
rounding and clamping.source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
The error for when
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>
Try to cast this collection of color components into a collection of
colors. Read more
source§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>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read moresource§impl<C, U> UintsFrom<C> for Uwhere
C: IntoUints<U>,
impl<C, U> UintsFrom<C> for Uwhere
C: IntoUints<U>,
source§fn uints_from(colors: C) -> U
fn uints_from(colors: C) -> U
Cast a collection of colors into a collection of unsigned integers.
source§impl<C, U> UintsInto<C> for Uwhere
C: FromUints<U>,
impl<C, U> UintsInto<C> for Uwhere
C: FromUints<U>,
source§fn uints_into(self) -> C
fn uints_into(self) -> C
Cast this collection of unsigned integers into a collection of colors.