pub type LinSrgba<T = f32> = Alpha<Rgb<Linear<Srgb>, T>, T>;
Expand description
Linear sRGB with an alpha component.
Aliased Type§
struct LinSrgba<T = f32> {
pub color: Rgb<Linear<Srgb>, T>,
pub alpha: T,
}
Fields§
§color: Rgb<Linear<Srgb>, T>
The color.
alpha: T
The transparency component. 0.0 is fully transparent and 1.0 is fully opaque.
Implementations
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>
pub fn into_format<U, B>(self) -> Alpha<Rgb<S, U>, B>
Convert into another component type.
sourcepub fn from_format<U, B>(color: Alpha<Rgb<S, U>, B>) -> Alpha<Rgb<S, T>, A>
pub fn from_format<U, B>(color: Alpha<Rgb<S, U>, B>) -> Alpha<Rgb<S, T>, A>
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(_: (T, T, T, A)) -> Alpha<Rgb<S, T>, A>
pub fn from_components(_: (T, T, T, A)) -> Alpha<Rgb<S, T>, A>
Convert from a (red, green, blue, alpha)
tuple.
source§impl<S, T, A> Alpha<Rgb<S, T>, A>
impl<S, T, A> Alpha<Rgb<S, T>, A>
Rgba
implementations.
sourcepub fn into_linear(self) -> Alpha<Rgb<Linear<<S as RgbStandard>::Space>, T>, A>
pub fn into_linear(self) -> Alpha<Rgb<Linear<<S as RgbStandard>::Space>, T>, A>
Convert the color to linear RGB with transparency.
sourcepub fn from_linear(
color: Alpha<Rgb<Linear<<S as RgbStandard>::Space>, T>, A>
) -> Alpha<Rgb<S, T>, A>
pub fn from_linear( color: Alpha<Rgb<Linear<<S as RgbStandard>::Space>, T>, A> ) -> Alpha<Rgb<S, T>, A>
Convert linear RGB to nonlinear RGB with transparency.
sourcepub fn into_encoding<St>(self) -> Alpha<Rgb<St, T>, A>
pub fn into_encoding<St>(self) -> Alpha<Rgb<St, T>, A>
Convert the color to a different encoding with transparency.
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<S, T, A> Into<(T, T, T, A)> for Alpha<Rgb<S, T>, A>
impl<S, T, A> Into<(T, T, T, A)> for Alpha<Rgb<S, 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<S, T> From<Alpha<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Alpha<Rgb<S, T>, T>
impl<S, T> From<Alpha<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Alpha<Rgb<S, T>, T>
source§impl<S, T> From<Alpha<Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Alpha<Rgb<S, T>, T>
impl<S, T> From<Alpha<Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Alpha<Rgb<S, T>, T>
source§impl<S, T> From<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
impl<S, T> From<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
source§fn from(
color: Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Alpha<Rgb<S, T>, T>
fn from( color: Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Alpha<Rgb<S, T>, T>
Converts to this type from the input type.
source§impl<S, T> From<Alpha<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Alpha<Rgb<S, T>, T>
impl<S, T> From<Alpha<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Alpha<Rgb<S, T>, T>
source§impl<S, T, _S> From<Luma<_S, T>> for Alpha<Rgb<S, T>, T>where
S: RgbStandard,
T: Component + Float,
_S: LumaStandard<WhitePoint = <<S as RgbStandard>::Space as RgbSpace>::WhitePoint>,
impl<S, T, _S> From<Luma<_S, T>> for Alpha<Rgb<S, T>, T>where
S: RgbStandard,
T: Component + Float,
_S: LumaStandard<WhitePoint = <<S as RgbStandard>::Space as RgbSpace>::WhitePoint>,
source§impl<S, T> From<Alpha<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Alpha<Rgb<S, T>, T>
impl<S, T> From<Alpha<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Alpha<Rgb<S, T>, T>
source§impl<S, T> From<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
impl<S, T> From<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
source§fn from(
color: Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Alpha<Rgb<S, T>, T>
fn from( color: Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Alpha<Rgb<S, T>, T>
Converts to this type from the input type.
source§impl<S, T> From<Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
impl<S, T> From<Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
source§fn from(
color: Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Alpha<Rgb<S, T>, T>
fn from( color: Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Alpha<Rgb<S, T>, T>
Converts to this type from the input type.
source§impl<S, T, _S> From<Alpha<Luma<_S, T>, T>> for Alpha<Rgb<S, T>, T>where
S: RgbStandard,
T: Component + Float,
_S: LumaStandard<WhitePoint = <<S as RgbStandard>::Space as RgbSpace>::WhitePoint>,
impl<S, T, _S> From<Alpha<Luma<_S, T>, T>> for Alpha<Rgb<S, T>, T>where
S: RgbStandard,
T: Component + Float,
_S: LumaStandard<WhitePoint = <<S as RgbStandard>::Space as RgbSpace>::WhitePoint>,
source§impl<S, T> From<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
impl<S, T> From<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Alpha<Rgb<S, T>, T>
source§fn from(
color: Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Alpha<Rgb<S, T>, T>
fn from( color: Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Alpha<Rgb<S, T>, T>
Converts to this type from the input type.
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