pub type Rgba<S = Srgb, T = f32> = Alpha<Rgb<S, T>, T>;
Expand description
Generic RGB with an alpha component. See the Rgba
implementation in
Alpha
.
Aliased Type§
struct Rgba<S = Srgb, T = f32> {
pub color: Rgb<S, T>,
pub alpha: T,
}
Fields§
§color: Rgb<S, T>
The color.
alpha: T
The transparency component. 0.0 (or 0u8) is fully transparent and 1.0 (or 255u8) is fully opaque.
Implementations
source§impl<C> Alpha<C, <C as Premultiply>::Scalar>where
C: Premultiply,
impl<C> Alpha<C, <C as Premultiply>::Scalar>where
C: Premultiply,
sourcepub fn premultiply(self) -> PreAlpha<C>
pub fn premultiply(self) -> PreAlpha<C>
Alpha mask the color by its transparency.
source§impl<C, A> Alpha<C, A>
impl<C, A> Alpha<C, A>
sourcepub fn iter<'a>(&'a self) -> <&'a Alpha<C, A> as IntoIterator>::IntoIterwhere
&'a Alpha<C, A>: IntoIterator,
pub fn iter<'a>(&'a self) -> <&'a Alpha<C, A> as IntoIterator>::IntoIterwhere
&'a Alpha<C, A>: IntoIterator,
Return an iterator over the colors in the wrapped collections.
sourcepub fn iter_mut<'a>(
&'a mut self,
) -> <&'a mut Alpha<C, A> as IntoIterator>::IntoIterwhere
&'a mut Alpha<C, A>: IntoIterator,
pub fn iter_mut<'a>(
&'a mut self,
) -> <&'a mut Alpha<C, A> as IntoIterator>::IntoIterwhere
&'a mut Alpha<C, A>: IntoIterator,
Return an iterator that allows modifying the colors in the wrapped collections.
source§impl<S, T, A> Alpha<Rgb<Linear<S>, T>, A>where
S: RgbSpace,
impl<S, T, A> Alpha<Rgb<Linear<S>, T>, A>where
S: RgbSpace,
sourcepub fn into_encoding<U, B, St>(self) -> Alpha<Rgb<St, U>, B>where
St: RgbStandard<Space = S>,
<St as RgbStandard>::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 as RgbStandard>::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>,
) -> Alpha<Rgb<Linear<S>, T>, A>where
St: RgbStandard<Space = S>,
<St as RgbStandard>::TransferFn: IntoLinear<T, U>,
A: FromStimulus<B>,
pub fn from_encoding<U, B, St>(
color: Alpha<Rgb<St, U>, B>,
) -> Alpha<Rgb<Linear<S>, T>, A>where
St: RgbStandard<Space = S>,
<St as RgbStandard>::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, &'a <I as SliceIndex<[T]>>::Output>, &'a <I as SliceIndex<[A]>>::Output>>
pub fn get<'a, I, T, A>( &'a self, index: I, ) -> Option<Alpha<Rgb<S, &'a <I as SliceIndex<[T]>>::Output>, &'a <I as SliceIndex<[A]>>::Output>>
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, &'a mut <I as SliceIndex<[T]>>::Output>, &'a mut <I as SliceIndex<[A]>>::Output>>
pub fn get_mut<'a, I, T, A>( &'a mut self, index: I, ) -> Option<Alpha<Rgb<S, &'a mut <I as SliceIndex<[T]>>::Output>, &'a mut <I as SliceIndex<[A]>>::Output>>
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, 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 the RGBA components into other number types.
use palette::Srgba;
let rgba_u8: Srgba<u8> = Srgba::new(0.3, 0.7, 0.2, 0.5).into_format();
See also into_linear
and into_encoding
for a faster option if you
need to change between linear and non-linear encoding at the same time.
sourcepub fn from_format<U, B>(color: Alpha<Rgb<S, U>, B>) -> Alpha<Rgb<S, T>, A>where
T: FromStimulus<U>,
A: FromStimulus<B>,
pub fn from_format<U, B>(color: Alpha<Rgb<S, U>, B>) -> Alpha<Rgb<S, T>, A>where
T: FromStimulus<U>,
A: FromStimulus<B>,
Convert the RGBA components from other number types.
use palette::Srgba;
let rgba_u8 = Srgba::<u8>::from_format(Srgba::new(0.3, 0.7, 0.2, 0.5));
See also from_linear
and from_encoding
for a faster option if you
need to change between linear and non-linear encoding at the same time.
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>where
S: RgbStandard,
impl<S, T, A> Alpha<Rgb<S, T>, A>where
S: RgbStandard,
sourcepub fn into_linear<U, B>(
self,
) -> Alpha<Rgb<Linear<<S as RgbStandard>::Space>, U>, B>
pub fn into_linear<U, B>( self, ) -> Alpha<Rgb<Linear<<S as RgbStandard>::Space>, U>, B>
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 as RgbStandard>::Space>, U>, B>,
) -> Alpha<Rgb<S, T>, A>
pub fn from_linear<U, B>( color: Alpha<Rgb<Linear<<S as RgbStandard>::Space>, U>, B>, ) -> Alpha<Rgb<S, T>, A>
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, 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) -> Alpha<Rgb<S, Vec<T>>, Vec<A>>
pub fn with_capacity(capacity: usize) -> Alpha<Rgb<S, Vec<T>>, Vec<A>>
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<S> Alpha<Rgb<S, u8>, u8>
impl<S> Alpha<Rgb<S, u8>, u8>
sourcepub fn into_u32<O>(self) -> u32
pub fn into_u32<O>(self) -> 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) -> Alpha<Rgb<S, u8>, u8>
pub fn from_u32<O>(color: u32) -> Alpha<Rgb<S, u8>, u8>
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.
Trait Implementations
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
source§fn abs_diff_eq(
&self,
other: &Alpha<C, T>,
epsilon: <T as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &Alpha<C, T>, epsilon: <T as AbsDiffEq>::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<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)
+=
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>)
+=
operation. Read moresource§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 as HasBoolMask>::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 as HasBoolMask>::Mask: LazySelect<T>,
source§fn multiply(self, other: Alpha<C, T>) -> Alpha<C, T>
fn multiply(self, other: Alpha<C, T>) -> Alpha<C, T>
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: Alpha<C, T>) -> Alpha<C, T>
fn screen(self, other: Alpha<C, T>) -> Alpha<C, T>
self
or other
.source§fn overlay(self, other: Alpha<C, T>) -> Alpha<C, T>
fn overlay(self, other: Alpha<C, T>) -> Alpha<C, T>
self
or other
if other is dark, or screen them if other
is light. This results in an S curve.source§fn darken(self, other: Alpha<C, T>) -> Alpha<C, T>
fn darken(self, other: Alpha<C, T>) -> Alpha<C, T>
self
and other
.source§fn lighten(self, other: Alpha<C, T>) -> Alpha<C, T>
fn lighten(self, other: Alpha<C, T>) -> Alpha<C, T>
self
and other
.source§fn dodge(self, other: Alpha<C, T>) -> Alpha<C, T>
fn dodge(self, other: Alpha<C, T>) -> Alpha<C, T>
other
to reflect self
. Results in other
if self
is
black.source§fn burn(self, other: Alpha<C, T>) -> Alpha<C, T>
fn burn(self, other: Alpha<C, T>) -> Alpha<C, T>
other
to reflect self
. Results in other
if self
is
white.source§fn hard_light(self, other: Alpha<C, T>) -> Alpha<C, T>
fn hard_light(self, other: Alpha<C, T>) -> Alpha<C, T>
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: Alpha<C, T>) -> Alpha<C, T>
fn soft_light(self, other: Alpha<C, T>) -> Alpha<C, T>
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: Alpha<C, T>) -> Alpha<C, T>
fn difference(self, other: Alpha<C, T>) -> Alpha<C, T>
self
and other
. It’s
basically abs(self - other)
, but regulated by the alpha component.source§impl<C> BlendWith for Alpha<C, <C as Premultiply>::Scalar>where
C: Premultiply,
impl<C> BlendWith for Alpha<C, <C as Premultiply>::Scalar>where
C: Premultiply,
source§fn blend_with<F>(
self,
destination: Alpha<C, <C as Premultiply>::Scalar>,
blend_function: F,
) -> Alpha<C, <C as Premultiply>::Scalar>
fn blend_with<F>( self, destination: Alpha<C, <C as Premultiply>::Scalar>, blend_function: F, ) -> Alpha<C, <C as Premultiply>::Scalar>
destination
, using
blend_function
. Anything that implements BlendFunction
is
acceptable, including functions and closures. Read moresource§impl<C, T> ClampAssign for Alpha<C, T>
impl<C, T> ClampAssign for Alpha<C, T>
source§fn clamp_assign(&mut self)
fn clamp_assign(&mut self)
source§impl<C> Compose for Alpha<C, <C as Premultiply>::Scalar>
impl<C> Compose for Alpha<C, <C as Premultiply>::Scalar>
source§fn over(
self,
other: Alpha<C, <C as Premultiply>::Scalar>,
) -> Alpha<C, <C as Premultiply>::Scalar>
fn over( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>
self
over other
. This is the good old common alpha composition
equation.source§fn inside(
self,
other: Alpha<C, <C as Premultiply>::Scalar>,
) -> Alpha<C, <C as Premultiply>::Scalar>
fn inside( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>
self
that overlaps the visible parts of
other
.source§fn outside(
self,
other: Alpha<C, <C as Premultiply>::Scalar>,
) -> Alpha<C, <C as Premultiply>::Scalar>
fn outside( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>
self
that lies outside the visible parts of
other
.source§fn atop(
self,
other: Alpha<C, <C as Premultiply>::Scalar>,
) -> Alpha<C, <C as Premultiply>::Scalar>
fn atop( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>
self
over only the visible parts of other
.source§fn xor(
self,
other: Alpha<C, <C as Premultiply>::Scalar>,
) -> Alpha<C, <C as Premultiply>::Scalar>
fn xor( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>
self
or other
, where they do not overlap.source§fn plus(
self,
other: Alpha<C, <C as Premultiply>::Scalar>,
) -> Alpha<C, <C as Premultiply>::Scalar>
fn plus( self, other: Alpha<C, <C as Premultiply>::Scalar>, ) -> Alpha<C, <C as Premultiply>::Scalar>
self
and other
. This uses the alpha component to regulate the
effect, so it’s not just plain component wise addition.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>,
source§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)
/=
operation. Read moresource§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>)
/=
operation. Read moresource§impl<Tc, Ta, C, A> Extend<Alpha<Tc, Ta>> for Alpha<C, A>
impl<Tc, Ta, C, A> Extend<Alpha<Tc, Ta>> for Alpha<C, A>
source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Alpha<Tc, Ta>>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = Alpha<Tc, Ta>>,
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<C> From<PreAlpha<C>> for Alpha<C, <C as Premultiply>::Scalar>where
C: Premultiply,
impl<C> From<PreAlpha<C>> for Alpha<C, <C as Premultiply>::Scalar>where
C: Premultiply,
source§impl<C1, C2, T> FromColorUnclamped<C1> for Alpha<C2, T>
impl<C1, C2, T> FromColorUnclamped<C1> for Alpha<C2, T>
source§fn from_color_unclamped(other: C1) -> Alpha<C2, T>
fn from_color_unclamped(other: C1) -> Alpha<C2, T>
source§impl<Tc, Ta, C, A> FromIterator<Alpha<Tc, Ta>> for Alpha<C, A>
impl<Tc, Ta, C, A> FromIterator<Alpha<Tc, Ta>> for Alpha<C, A>
source§impl<S> FromStr for Alpha<Rgb<S, u8>, u8>
impl<S> FromStr for Alpha<Rgb<S, u8>, u8>
source§fn from_str(
hex: &str,
) -> Result<Alpha<Rgb<S, u8>, u8>, <Alpha<Rgb<S, u8>, u8> as FromStr>::Err>
fn from_str( hex: &str, ) -> Result<Alpha<Rgb<S, u8>, u8>, <Alpha<Rgb<S, u8>, u8> as FromStr>::Err>
Parses a color hex code of format ‘#ff00bbff’ or ‘#abcd’ (with or without the leading ‘#’) into a
Rgba<S, u8>
instance.
source§type Err = FromHexError
type Err = FromHexError
source§impl<C, T> HasBoolMask for Alpha<C, T>
impl<C, T> HasBoolMask for Alpha<C, T>
source§type Mask = <C as HasBoolMask>::Mask
type Mask = <C as HasBoolMask>::Mask
Self
values.source§impl<'a, S, T> IntoIterator for Alpha<Rgb<S, &'a [T]>, &'a [T]>
impl<'a, S, T> IntoIterator for Alpha<Rgb<S, &'a [T]>, &'a [T]>
source§impl<'a, S, T> IntoIterator for Alpha<Rgb<S, &'a mut [T]>, &'a mut [T]>
impl<'a, S, T> IntoIterator for Alpha<Rgb<S, &'a mut [T]>, &'a mut [T]>
source§impl<S, T, const N: usize> IntoIterator for Alpha<Rgb<S, [T; N]>, [T; N]>
impl<S, T, const N: usize> IntoIterator for Alpha<Rgb<S, [T; N]>, [T; N]>
source§impl<'a, S, T> IntoIterator for Alpha<Rgb<S, Vec<T>>, Vec<T>>
impl<'a, S, T> IntoIterator for Alpha<Rgb<S, Vec<T>>, Vec<T>>
source§impl<C, T> IsWithinBounds for Alpha<C, T>where
C: IsWithinBounds,
T: Stimulus + PartialCmp<Mask = <C as HasBoolMask>::Mask> + IsWithinBounds,
<C as HasBoolMask>::Mask: BitAnd<Output = <C as HasBoolMask>::Mask>,
impl<C, T> IsWithinBounds for Alpha<C, T>where
C: IsWithinBounds,
T: Stimulus + PartialCmp<Mask = <C as HasBoolMask>::Mask> + IsWithinBounds,
<C as HasBoolMask>::Mask: BitAnd<Output = <C as HasBoolMask>::Mask>,
source§fn is_within_bounds(&self) -> <C as HasBoolMask>::Mask
fn is_within_bounds(&self) -> <C as HasBoolMask>::Mask
source§impl<C> Lighten for Alpha<C, <C as Lighten>::Scalar>where
C: Lighten,
impl<C> Lighten for Alpha<C, <C as Lighten>::Scalar>where
C: Lighten,
source§impl<C> LightenAssign for Alpha<C, <C as LightenAssign>::Scalar>where
C: LightenAssign,
impl<C> LightenAssign for Alpha<C, <C as LightenAssign>::Scalar>where
C: LightenAssign,
source§type Scalar = <C as LightenAssign>::Scalar
type Scalar = <C as LightenAssign>::Scalar
source§fn lighten_assign(&mut self, factor: <C as LightenAssign>::Scalar)
fn lighten_assign(&mut self, factor: <C as LightenAssign>::Scalar)
source§fn lighten_fixed_assign(&mut self, amount: <C as LightenAssign>::Scalar)
fn lighten_fixed_assign(&mut self, amount: <C as LightenAssign>::Scalar)
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)
*=
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>)
*=
operation. Read moresource§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
source§fn relative_eq(
&self,
other: &Alpha<C, T>,
epsilon: <Alpha<C, T> as AbsDiffEq>::Epsilon,
max_relative: <Alpha<C, T> as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &Alpha<C, T>, epsilon: <Alpha<C, T> as AbsDiffEq>::Epsilon, max_relative: <Alpha<C, T> as AbsDiffEq>::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> Saturate for Alpha<C, <C as Saturate>::Scalar>where
C: Saturate,
impl<C> Saturate for Alpha<C, <C as Saturate>::Scalar>where
C: Saturate,
source§impl<C> SaturateAssign for Alpha<C, <C as SaturateAssign>::Scalar>where
C: SaturateAssign,
impl<C> SaturateAssign for Alpha<C, <C as SaturateAssign>::Scalar>where
C: SaturateAssign,
source§type Scalar = <C as SaturateAssign>::Scalar
type Scalar = <C as SaturateAssign>::Scalar
source§fn saturate_assign(&mut self, factor: <C as SaturateAssign>::Scalar)
fn saturate_assign(&mut self, factor: <C as SaturateAssign>::Scalar)
factor
, a value
ranging from 0.0
to 1.0
. Read moresource§fn saturate_fixed_assign(&mut self, amount: <C as SaturateAssign>::Scalar)
fn saturate_fixed_assign(&mut self, amount: <C as SaturateAssign>::Scalar)
source§impl<T, C> SaturatingAdd<T> for Alpha<C, T>
impl<T, C> SaturatingAdd<T> for Alpha<C, T>
source§type Output = Alpha<<C as SaturatingAdd<T>>::Output, <T as SaturatingAdd>::Output>
type Output = Alpha<<C as SaturatingAdd<T>>::Output, <T as SaturatingAdd>::Output>
source§fn saturating_add(self, c: T) -> <Alpha<C, T> as SaturatingAdd<T>>::Output
fn saturating_add(self, c: T) -> <Alpha<C, T> as SaturatingAdd<T>>::Output
self
and other
, but saturates instead of overflowing.source§impl<C, T> SaturatingAdd for Alpha<C, T>where
C: SaturatingAdd,
T: SaturatingAdd,
impl<C, T> SaturatingAdd for Alpha<C, T>where
C: SaturatingAdd,
T: SaturatingAdd,
source§type Output = Alpha<<C as SaturatingAdd>::Output, <T as SaturatingAdd>::Output>
type Output = Alpha<<C as SaturatingAdd>::Output, <T as SaturatingAdd>::Output>
source§fn saturating_add(
self,
other: Alpha<C, T>,
) -> <Alpha<C, T> as SaturatingAdd>::Output
fn saturating_add( self, other: Alpha<C, T>, ) -> <Alpha<C, T> as SaturatingAdd>::Output
self
and other
, but saturates instead of overflowing.source§impl<T, C> SaturatingSub<T> for Alpha<C, T>
impl<T, C> SaturatingSub<T> for Alpha<C, T>
source§type Output = Alpha<<C as SaturatingSub<T>>::Output, <T as SaturatingSub>::Output>
type Output = Alpha<<C as SaturatingSub<T>>::Output, <T as SaturatingSub>::Output>
source§fn saturating_sub(self, c: T) -> <Alpha<C, T> as SaturatingSub<T>>::Output
fn saturating_sub(self, c: T) -> <Alpha<C, T> as SaturatingSub<T>>::Output
self
and other
, but saturates instead of overflowing.source§impl<C, T> SaturatingSub for Alpha<C, T>where
C: SaturatingSub,
T: SaturatingSub,
impl<C, T> SaturatingSub for Alpha<C, T>where
C: SaturatingSub,
T: SaturatingSub,
source§type Output = Alpha<<C as SaturatingSub>::Output, <T as SaturatingSub>::Output>
type Output = Alpha<<C as SaturatingSub>::Output, <T as SaturatingSub>::Output>
source§fn saturating_sub(
self,
other: Alpha<C, T>,
) -> <Alpha<C, T> as SaturatingSub>::Output
fn saturating_sub( self, other: Alpha<C, T>, ) -> <Alpha<C, T> as SaturatingSub>::Output
self
and other
, but saturates instead of overflowing.source§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,
source§impl<C, T> ShiftHueAssign for Alpha<C, T>where
C: ShiftHueAssign,
impl<C, T> ShiftHueAssign for Alpha<C, T>where
C: ShiftHueAssign,
source§type Scalar = <C as ShiftHueAssign>::Scalar
type Scalar = <C as ShiftHueAssign>::Scalar
source§fn shift_hue_assign(&mut self, amount: <Alpha<C, T> as ShiftHueAssign>::Scalar)
fn shift_hue_assign(&mut self, amount: <Alpha<C, T> as ShiftHueAssign>::Scalar)
amount
.source§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)
-=
operation. Read moresource§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>)
-=
operation. Read moresource§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
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) -> <Alpha<C, A> as WithAlpha<A>>::WithAlpha
fn with_alpha(self, alpha: A) -> <Alpha<C, A> as WithAlpha<A>>::WithAlpha
Self
already has a transparency, it is
overwritten. Read more