Type Alias nannou_core::prelude::rgb::GammaSrgb
source · pub type GammaSrgb<T = f32> = Rgb<Gamma<Srgb>, T>;
Expand description
Gamma 2.2 encoded sRGB.
Aliased Type§
struct GammaSrgb<T = f32> {
pub red: T,
pub green: T,
pub blue: T,
pub standard: PhantomData<Gamma<Srgb>>,
}
Fields§
§red: T
The amount of red light, where 0.0 is no red light and 1.0f (or 255u8) is the highest displayable amount.
green: T
The amount of green light, where 0.0 is no green light and 1.0f (or 255u8) is the highest displayable amount.
blue: T
The amount of blue light, where 0.0 is no blue light and 1.0f (or 255u8) is the highest displayable amount.
standard: PhantomData<Gamma<Srgb>>
The kind of RGB standard. sRGB is the default.
Implementations
source§impl<S, T> Rgb<S, T>where
S: RgbStandard,
T: Component,
impl<S, T> Rgb<S, T>where
S: RgbStandard,
T: Component,
sourcepub fn into_format<U>(self) -> Rgb<S, U>where
U: Component,
pub fn into_format<U>(self) -> Rgb<S, U>where
U: Component,
Convert into another component type.
sourcepub fn from_format<U>(color: Rgb<S, U>) -> Rgb<S, T>where
U: Component,
pub fn from_format<U>(color: Rgb<S, U>) -> Rgb<S, T>where
U: Component,
Convert from another component type.
sourcepub fn into_components(self) -> (T, T, T)
pub fn into_components(self) -> (T, T, T)
Convert to a (red, green, blue)
tuple.
sourcepub fn from_components(_: (T, T, T)) -> Rgb<S, T>
pub fn from_components(_: (T, T, T)) -> Rgb<S, T>
Convert from a (red, green, blue)
tuple.
source§impl<S, T> Rgb<S, T>
impl<S, T> Rgb<S, T>
sourcepub fn into_linear(self) -> Rgb<Linear<<S as RgbStandard>::Space>, T>
pub fn into_linear(self) -> Rgb<Linear<<S as RgbStandard>::Space>, T>
Convert the color to linear RGB.
sourcepub fn from_linear(
color: Rgb<Linear<<S as RgbStandard>::Space>, T>
) -> Rgb<S, T>
pub fn from_linear( color: Rgb<Linear<<S as RgbStandard>::Space>, T> ) -> Rgb<S, T>
Convert linear RGB to nonlinear RGB.
sourcepub fn into_encoding<St>(self) -> Rgb<St, T>
pub fn into_encoding<St>(self) -> Rgb<St, T>
Convert the color to a different encoding.
sourcepub fn from_encoding<St>(color: Rgb<St, T>) -> Rgb<S, T>
pub fn from_encoding<St>(color: Rgb<St, T>) -> Rgb<S, T>
Convert RGB from a different encoding.
Trait Implementations
source§impl<S, T> FromColor<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> for Rgb<S, T>
impl<S, T> FromColor<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> for Rgb<S, T>
source§fn from_xyz(
color: Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Rgb<S, T>
fn from_xyz( color: Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Rgb<S, T>
Convert from XYZ color space
source§fn from_luma(
color: Luma<Linear<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint>, T>
) -> Rgb<S, T>
fn from_luma( color: Luma<Linear<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint>, T> ) -> Rgb<S, T>
Convert from Luma
source§impl<S, T> DivAssign<T> for Rgb<S, T>
impl<S, T> DivAssign<T> for Rgb<S, T>
source§fn div_assign(&mut self, c: T)
fn div_assign(&mut self, c: T)
Performs the
/=
operation. Read moresource§impl<S, T> DivAssign for Rgb<S, T>
impl<S, T> DivAssign for Rgb<S, T>
source§fn div_assign(&mut self, other: Rgb<S, T>)
fn div_assign(&mut self, other: Rgb<S, T>)
Performs the
/=
operation. Read moreimpl<S, T> Copy for Rgb<S, T>where
S: RgbStandard,
T: Component,
source§impl<S, T> UlpsEq for Rgb<S, T>
impl<S, T> UlpsEq for Rgb<S, 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> AbsDiffEq for Rgb<S, T>
impl<S, T> AbsDiffEq for Rgb<S, T>
source§fn default_epsilon() -> <Rgb<S, T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <Rgb<S, T> as AbsDiffEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§impl<S, T> RelativeEq for Rgb<S, T>
impl<S, T> RelativeEq for Rgb<S, T>
source§fn default_max_relative() -> <Rgb<S, T> as AbsDiffEq>::Epsilon
fn default_max_relative() -> <Rgb<S, T> as AbsDiffEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§impl<S, T> SubAssign<T> for Rgb<S, T>
impl<S, T> SubAssign<T> for Rgb<S, T>
source§fn sub_assign(&mut self, c: T)
fn sub_assign(&mut self, c: T)
Performs the
-=
operation. Read moresource§impl<S, T> SubAssign for Rgb<S, T>
impl<S, T> SubAssign for Rgb<S, T>
source§fn sub_assign(&mut self, other: Rgb<S, T>)
fn sub_assign(&mut self, other: Rgb<S, T>)
Performs the
-=
operation. Read moresource§impl<S, T> ComponentWise for Rgb<S, T>where
S: RgbStandard,
T: Component,
impl<S, T> ComponentWise for Rgb<S, T>where
S: RgbStandard,
T: Component,
source§impl<S, T> AddAssign<T> for Rgb<S, T>
impl<S, T> AddAssign<T> for Rgb<S, T>
source§fn add_assign(&mut self, c: T)
fn add_assign(&mut self, c: T)
Performs the
+=
operation. Read moresource§impl<S, T> AddAssign for Rgb<S, T>
impl<S, T> AddAssign for Rgb<S, T>
source§fn add_assign(&mut self, other: Rgb<S, T>)
fn add_assign(&mut self, other: Rgb<S, T>)
Performs the
+=
operation. Read moresource§impl<S, T> Blend for Rgb<S, T>
impl<S, T> Blend for Rgb<S, T>
source§fn into_premultiplied(self) -> PreAlpha<Rgb<S, T>, T>
fn into_premultiplied(self) -> PreAlpha<Rgb<S, T>, T>
Convert the color to premultiplied alpha.
source§fn from_premultiplied(color: PreAlpha<Rgb<S, T>, T>) -> Rgb<S, T>
fn from_premultiplied(color: PreAlpha<Rgb<S, T>, T>) -> Rgb<S, 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, Sp, Wp> From<Hsl<Sp, T>> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
Sp: RgbSpace<WhitePoint = Wp>,
impl<S, T, Sp, Wp> From<Hsl<Sp, T>> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
Sp: RgbSpace<WhitePoint = Wp>,
source§impl<S, T, _S> From<Alpha<Luma<_S, T>, T>> for Rgb<S, 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 Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
_S: LumaStandard<WhitePoint = <<S as RgbStandard>::Space as RgbSpace>::WhitePoint>,
source§impl<S, T> From<Alpha<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Rgb<S, T>
impl<S, T> From<Alpha<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Rgb<S, T>
source§fn from(
color: Alpha<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>
) -> Rgb<S, T>
fn from( color: Alpha<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T> ) -> Rgb<S, T>
Converts to this type from the input type.
source§impl<S, T, Sp, Wp> From<Hsv<Sp, T>> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
Sp: RgbSpace<WhitePoint = Wp>,
impl<S, T, Sp, Wp> From<Hsv<Sp, T>> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
Sp: RgbSpace<WhitePoint = Wp>,
source§impl<S, T> From<Alpha<Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Rgb<S, T>
impl<S, T> From<Alpha<Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Rgb<S, T>
source§fn from(
color: Alpha<Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>
) -> Rgb<S, T>
fn from( color: Alpha<Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T> ) -> Rgb<S, T>
Converts to this type from the input type.
source§impl<S, T, St, Wp> From<Luma<St, T>> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
St: LumaStandard<WhitePoint = Wp>,
impl<S, T, St, Wp> From<Luma<St, T>> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
St: LumaStandard<WhitePoint = Wp>,
source§impl<S, T> From<Alpha<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Rgb<S, T>
impl<S, T> From<Alpha<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Rgb<S, T>
source§fn from(
color: Alpha<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>
) -> Rgb<S, T>
fn from( color: Alpha<Xyz<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T> ) -> Rgb<S, T>
Converts to this type from the input type.
source§impl<S, T> From<Alpha<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Rgb<S, T>
impl<S, T> From<Alpha<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>> for Rgb<S, T>
source§fn from(
color: Alpha<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T>
) -> Rgb<S, T>
fn from( color: Alpha<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>, T> ) -> Rgb<S, T>
Converts to this type from the input type.
source§impl<S, Wp, T> From<Xyz<Wp, T>> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
impl<S, Wp, T> From<Xyz<Wp, T>> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
source§impl<S, T> From<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Rgb<S, T>
impl<S, T> From<Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Rgb<S, T>
source§fn from(
color: Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Rgb<S, T>
fn from( color: Lch<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Rgb<S, T>
Converts to this type from the input type.
source§impl<S, T> From<Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Rgb<S, T>
impl<S, T> From<Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Rgb<S, T>
source§fn from(
color: Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Rgb<S, T>
fn from( color: Lab<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Rgb<S, T>
Converts to this type from the input type.
source§impl<S, T> From<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Rgb<S, T>
impl<S, T> From<Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>> for Rgb<S, T>
source§fn from(
color: Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T>
) -> Rgb<S, T>
fn from( color: Yxy<<<S as RgbStandard>::Space as RgbSpace>::WhitePoint, T> ) -> Rgb<S, T>
Converts to this type from the input type.
source§impl<S, T, Wp> IntoColor<Wp, T> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
impl<S, T, Wp> IntoColor<Wp, T> for Rgb<S, T>where
S: RgbStandard,
T: Component + Float,
Wp: WhitePoint,
<S as RgbStandard>::Space: RgbSpace<WhitePoint = Wp>,
source§fn into_rgb<Sp>(self) -> Rgb<Linear<Sp>, T>where
Sp: RgbSpace<WhitePoint = Wp>,
fn into_rgb<Sp>(self) -> Rgb<Linear<Sp>, T>where
Sp: RgbSpace<WhitePoint = Wp>,
Convert into RGB color space.
source§fn into_hsl<Sp>(self) -> Hsl<Sp, T>where
Sp: RgbSpace<WhitePoint = Wp>,
fn into_hsl<Sp>(self) -> Hsl<Sp, T>where
Sp: RgbSpace<WhitePoint = Wp>,
Convert into HSL color space
source§fn into_hsv<Sp>(self) -> Hsv<Sp, T>where
Sp: RgbSpace<WhitePoint = Wp>,
fn into_hsv<Sp>(self) -> Hsv<Sp, T>where
Sp: RgbSpace<WhitePoint = Wp>,
Convert into HSV color space
source§impl<S, T> Limited for Rgb<S, T>where
S: RgbStandard,
T: Component,
impl<S, T> Limited for Rgb<S, T>where
S: RgbStandard,
T: Component,
source§impl<'de, S, T> Deserialize<'de> for Rgb<S, T>
impl<'de, S, T> Deserialize<'de> for Rgb<S, T>
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Rgb<S, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Rgb<S, T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<S, T> PartialEq for Rgb<S, T>
impl<S, T> PartialEq for Rgb<S, T>
impl<S, T> StructuralPartialEq for Rgb<S, T>where
S: RgbStandard,
T: Component,
source§impl<S, T> MulAssign for Rgb<S, T>
impl<S, T> MulAssign for Rgb<S, T>
source§fn mul_assign(&mut self, other: Rgb<S, T>)
fn mul_assign(&mut self, other: Rgb<S, T>)
Performs the
*=
operation. Read moresource§impl<S, T> MulAssign<T> for Rgb<S, T>
impl<S, T> MulAssign<T> for Rgb<S, T>
source§fn mul_assign(&mut self, c: T)
fn mul_assign(&mut self, c: T)
Performs the
*=
operation. Read moresource§impl<S, T> Serialize for Rgb<S, T>
impl<S, T> Serialize for Rgb<S, 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<S, T> Pixel<T> for Rgb<S, T>where
S: RgbStandard,
T: Component,
impl<S, T> Pixel<T> for Rgb<S, T>where
S: RgbStandard,
T: Component,
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