pub type Laba<Wp, T = f32> = Alpha<Lab<Wp, T>, T>;
Expand description
CIE L*a*b* (CIELAB) with an alpha component. See the Laba
implementation in Alpha
.
Aliased Type§
struct Laba<Wp, T = f32> {
pub color: Lab<Wp, T>,
pub alpha: T,
}
Fields§
§color: Lab<Wp, T>
The color.
alpha: T
The transparency component. 0.0 is fully transparent and 1.0 is fully opaque.
Implementations
source§impl<Wp, T, A> Alpha<Lab<Wp, T>, A>
impl<Wp, T, A> Alpha<Lab<Wp, T>, A>
Laba
implementations.
sourcepub fn with_wp(l: T, a: T, b: T, alpha: A) -> Alpha<Lab<Wp, T>, A>
pub fn with_wp(l: T, a: T, b: T, alpha: A) -> Alpha<Lab<Wp, T>, A>
CIE L*a*b* and transparency.
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(_: (T, T, T, A)) -> Alpha<Lab<Wp, T>, A>
pub fn from_components(_: (T, T, T, A)) -> Alpha<Lab<Wp, T>, A>
Convert from a (L\*, a\*, b\*, alpha)
tuple.
Trait Implementations
source§impl<C, S, T> IntoLinSrgba<S> for Alpha<C, T>
impl<C, S, T> IntoLinSrgba<S> for Alpha<C, T>
source§impl<C, T> DivAssign for Alpha<C, T>
impl<C, T> DivAssign for Alpha<C, T>
source§fn div_assign(&mut self, other: Alpha<C, T>)
fn div_assign(&mut self, other: Alpha<C, T>)
Performs the
/=
operation. Read moresource§impl<T, C> DivAssign<T> for Alpha<C, T>
impl<T, C> DivAssign<T> for Alpha<C, T>
source§fn div_assign(&mut self, c: T)
fn div_assign(&mut self, c: T)
Performs the
/=
operation. Read moreimpl<C, T> Copy for Alpha<C, T>
source§impl<C, T> UlpsEq for Alpha<C, T>
impl<C, T> UlpsEq for Alpha<C, T>
source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
source§impl<Wp, T, A> Into<(T, T, T, A)> for Alpha<Lab<Wp, T>, A>
impl<Wp, T, A> Into<(T, T, T, A)> for Alpha<Lab<Wp, T>, A>
source§fn into(self) -> (T, T, T, A)
fn into(self) -> (T, T, T, A)
Converts this type into the (usually inferred) input type.
source§impl<C, T> AbsDiffEq for Alpha<C, T>
impl<C, T> AbsDiffEq for Alpha<C, T>
source§fn default_epsilon() -> <Alpha<C, T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <Alpha<C, T> as AbsDiffEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§impl<C, T> RelativeEq for Alpha<C, T>where
C: RelativeEq<Epsilon = <T as AbsDiffEq>::Epsilon>,
T: RelativeEq,
<T as AbsDiffEq>::Epsilon: Clone,
impl<C, T> RelativeEq for Alpha<C, T>where
C: RelativeEq<Epsilon = <T as AbsDiffEq>::Epsilon>,
T: RelativeEq,
<T as AbsDiffEq>::Epsilon: Clone,
source§fn default_max_relative() -> <Alpha<C, T> as AbsDiffEq>::Epsilon
fn default_max_relative() -> <Alpha<C, T> as AbsDiffEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§impl<C, T> SubAssign for Alpha<C, T>
impl<C, T> SubAssign for Alpha<C, T>
source§fn sub_assign(&mut self, other: Alpha<C, T>)
fn sub_assign(&mut self, other: Alpha<C, T>)
Performs the
-=
operation. Read moresource§impl<T, C> SubAssign<T> for Alpha<C, T>
impl<T, C> SubAssign<T> for Alpha<C, T>
source§fn sub_assign(&mut self, c: T)
fn sub_assign(&mut self, c: T)
Performs the
-=
operation. Read moresource§impl<C, T> ComponentWise for Alpha<C, T>where
C: ComponentWise<Scalar = T>,
T: Clone,
impl<C, T> ComponentWise for Alpha<C, T>where
C: ComponentWise<Scalar = T>,
T: Clone,
source§impl<T, C> AddAssign<T> for Alpha<C, T>
impl<T, C> AddAssign<T> for Alpha<C, T>
source§fn add_assign(&mut self, c: T)
fn add_assign(&mut self, c: T)
Performs the
+=
operation. Read moresource§impl<C, T> AddAssign for Alpha<C, T>
impl<C, T> AddAssign for Alpha<C, T>
source§fn add_assign(&mut self, other: Alpha<C, T>)
fn add_assign(&mut self, other: Alpha<C, T>)
Performs the
+=
operation. Read moresource§impl<C, T> Blend for Alpha<C, T>
impl<C, T> Blend for Alpha<C, T>
source§fn into_premultiplied(self) -> PreAlpha<<C as Blend>::Color, T>
fn into_premultiplied(self) -> PreAlpha<<C as Blend>::Color, T>
Convert the color to premultiplied alpha.
source§fn from_premultiplied(color: PreAlpha<<C as Blend>::Color, T>) -> Alpha<C, T>
fn from_premultiplied(color: PreAlpha<<C as Blend>::Color, T>) -> Alpha<C, T>
Convert the color from premultiplied alpha.
source§fn blend<F>(self, destination: Self, blend_function: F) -> Selfwhere
F: BlendFunction<Self::Color>,
fn blend<F>(self, destination: 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§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§fn outside(self, other: Self) -> Self
fn outside(self, other: Self) -> Self
Results in the parts of
self
that lies outside the visible parts of
other
.source§fn plus(self, other: Self) -> Self
fn plus(self, other: Self) -> Self
Add
self
and other
. This uses the alpha component to regulate the
effect, so it’s not just plain component wise addition.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<Wp, T, _S> From<Alpha<Rgb<_S, T>, T>> for Alpha<Lab<Wp, T>, T>where
T: Component + Float,
Wp: WhitePoint,
_S: RgbStandard,
<_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Alpha<Rgb<_S, T>, T>> for Alpha<Lab<Wp, T>, T>where
T: Component + Float,
Wp: WhitePoint,
_S: RgbStandard,
<_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
source§impl<Wp, T, _S> From<Rgb<_S, T>> for Alpha<Lab<Wp, T>, T>where
T: Component + Float,
Wp: WhitePoint,
_S: RgbStandard,
<_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
impl<Wp, T, _S> From<Rgb<_S, T>> for Alpha<Lab<Wp, T>, T>where
T: Component + Float,
Wp: WhitePoint,
_S: RgbStandard,
<_S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
source§impl<C, T> Limited for Alpha<C, T>
impl<C, T> Limited for Alpha<C, T>
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<Alpha<C, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Alpha<C, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<C, T> PartialEq for Alpha<C, T>
impl<C, T> PartialEq for Alpha<C, T>
impl<C, T> StructuralPartialEq for Alpha<C, T>
source§impl<T, C> MulAssign<T> for Alpha<C, T>
impl<T, C> MulAssign<T> for Alpha<C, T>
source§fn mul_assign(&mut self, c: T)
fn mul_assign(&mut self, c: T)
Performs the
*=
operation. Read moresource§impl<C, T> MulAssign for Alpha<C, T>
impl<C, T> MulAssign for Alpha<C, T>
source§fn mul_assign(&mut self, other: Alpha<C, T>)
fn mul_assign(&mut self, other: Alpha<C, T>)
Performs the
*=
operation. Read moresource§impl<C, T> Serialize for Alpha<C, T>
impl<C, T> Serialize for Alpha<C, T>
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl<T, C> Pixel<T> for Alpha<C, T>where
C: Pixel<T>,
impl<T, C> Pixel<T> for Alpha<C, T>where
C: Pixel<T>,
source§fn as_raw_mut<P>(&mut self) -> &mut P
fn as_raw_mut<P>(&mut self) -> &mut P
Cast as a mutable reference to raw color components.
source§fn into_raw<P>(self) -> Pwhere
P: RawPixelSized<T>,
fn into_raw<P>(self) -> Pwhere
P: RawPixelSized<T>,
Convert from raw color components.
source§fn from_raw_mut<P>(pixel: &mut P) -> &mut Self
fn from_raw_mut<P>(pixel: &mut P) -> &mut Self
Cast from a mutable reference to raw color components.
source§fn from_raw_slice(slice: &[T]) -> &[Self]
fn from_raw_slice(slice: &[T]) -> &[Self]
Cast a slice of raw color components to a slice of colors. Read more
source§fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]
fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]
Cast a mutable slice of raw color components to a mutable slice of colors. Read more