Struct nannou::prelude::Hsl [−][src]
pub struct Hsl<T = f32> where
T: Float, { pub hue: RgbHue<T>, pub saturation: T, pub lightness: T, }
Linear HSL color space.
The HSL color space can be seen as a cylindrical version of
RGB, where the hue
is the angle around the color
cylinder, the saturation
is the distance from the center, and the
lightness
is the height from the bottom. Its composition makes it
especially good for operations like changing green to red, making a color
more gray, or making it darker.
See HSV for a very similar color space, with brightness instead of lightness.
Fields
hue: RgbHue<T>
The hue of the color, in degrees. Decides if it's red, blue, purple, etc.
saturation: T
The colorfulness of the color. 0.0 gives gray scale colors and 1.0 will give absolutely clear colors.
lightness: T
Decides how light the color will look. 0.0 will be black, 0.5 will give a clear color, and 1.0 will give white.
Methods
impl<T> Hsl<T> where
T: Float,
[src]
impl<T> Hsl<T> where
T: Float,
Trait Implementations
impl<T> Shade for Hsl<T> where
T: Float,
[src]
impl<T> Shade for Hsl<T> where
T: Float,
type Scalar = T
The type of the lighten/darken amount.
fn lighten(&self, amount: T) -> Hsl<T>
[src]
fn lighten(&self, amount: T) -> Hsl<T>
Lighten the color by amount
.
fn darken(&self, amount: Self::Scalar) -> Self
[src]
fn darken(&self, amount: Self::Scalar) -> Self
Darken the color by amount
.
impl<T> ApproxEq for Hsl<T> where
T: ApproxEq + Float,
<T as ApproxEq>::Epsilon: Copy,
<T as ApproxEq>::Epsilon: Float,
[src]
impl<T> ApproxEq for Hsl<T> where
T: ApproxEq + Float,
<T as ApproxEq>::Epsilon: Copy,
<T as ApproxEq>::Epsilon: Float,
type Epsilon = <T as ApproxEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> <Hsl<T> as ApproxEq>::Epsilon
[src]
fn default_epsilon() -> <Hsl<T> as ApproxEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> <Hsl<T> as ApproxEq>::Epsilon
[src]
fn default_max_relative() -> <Hsl<T> as ApproxEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(
&self,
other: &Hsl<T>,
epsilon: <Hsl<T> as ApproxEq>::Epsilon,
max_relative: <Hsl<T> as ApproxEq>::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &Hsl<T>,
epsilon: <Hsl<T> as ApproxEq>::Epsilon,
max_relative: <Hsl<T> as ApproxEq>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(
&self,
other: &Hsl<T>,
epsilon: <Hsl<T> as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
[src]
fn ulps_eq(
&self,
other: &Hsl<T>,
epsilon: <Hsl<T> as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(
&self,
other: &Hsl<T>,
epsilon: <Hsl<T> as ApproxEq>::Epsilon,
max_relative: <Hsl<T> as ApproxEq>::Epsilon
) -> bool
[src]
fn relative_ne(
&self,
other: &Hsl<T>,
epsilon: <Hsl<T> as ApproxEq>::Epsilon,
max_relative: <Hsl<T> as ApproxEq>::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(
&self,
other: &Hsl<T>,
epsilon: <Hsl<T> as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
[src]
fn ulps_ne(
&self,
other: &Hsl<T>,
epsilon: <Hsl<T> as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
The inverse of ApproxEq::ulps_eq
.
impl<T> Mix for Hsl<T> where
T: Float,
[src]
impl<T> Mix for Hsl<T> where
T: Float,
type Scalar = T
The type of the mixing factor.
fn mix(&self, other: &Hsl<T>, factor: T) -> Hsl<T>
[src]
fn mix(&self, other: &Hsl<T>, factor: T) -> Hsl<T>
Mix the color with an other color, by factor
. Read more
impl<T> Saturate for Hsl<T> where
T: Float,
[src]
impl<T> Saturate for Hsl<T> where
T: Float,
type Scalar = T
The type of the (de)saturation factor.
fn saturate(&self, factor: T) -> Hsl<T>
[src]
fn saturate(&self, factor: T) -> Hsl<T>
Increase the saturation by factor
.
fn desaturate(&self, factor: Self::Scalar) -> Self
[src]
fn desaturate(&self, factor: Self::Scalar) -> Self
Decrease the saturation by factor
.
impl<T> Add<Hsl<T>> for Hsl<T> where
T: Float,
[src]
impl<T> Add<Hsl<T>> for Hsl<T> where
T: Float,
type Output = Hsl<T>
The resulting type after applying the +
operator.
fn add(self, other: Hsl<T>) -> Hsl<T>
[src]
fn add(self, other: Hsl<T>) -> Hsl<T>
Performs the +
operation.
impl<T> Add<T> for Hsl<T> where
T: Float,
[src]
impl<T> Add<T> for Hsl<T> where
T: Float,
type Output = Hsl<T>
The resulting type after applying the +
operator.
fn add(self, c: T) -> Hsl<T>
[src]
fn add(self, c: T) -> Hsl<T>
Performs the +
operation.
impl<T> Hue for Hsl<T> where
T: Float,
[src]
impl<T> Hue for Hsl<T> where
T: Float,
fn with_hue(&self, hue: RgbHue<T>) -> Hsl<T>
[src]
fn with_hue(&self, hue: RgbHue<T>) -> Hsl<T>
Return a new copy of self
, but with a specific hue.
fn shift_hue(&self, amount: RgbHue<T>) -> Hsl<T>
[src]
fn shift_hue(&self, amount: RgbHue<T>) -> Hsl<T>
Return a new copy of self
, but with the hue shifted by amount
.
impl<T> GetHue for Hsl<T> where
T: Float,
[src]
impl<T> GetHue for Hsl<T> where
T: Float,
type Hue = RgbHue<T>
The kind of hue unit this color space uses. Read more
fn get_hue(&self) -> Option<RgbHue<T>>
[src]
fn get_hue(&self) -> Option<RgbHue<T>>
Calculate a hue if possible. Read more
impl<T> Sub<Hsl<T>> for Hsl<T> where
T: Float,
[src]
impl<T> Sub<Hsl<T>> for Hsl<T> where
T: Float,
type Output = Hsl<T>
The resulting type after applying the -
operator.
fn sub(self, other: Hsl<T>) -> Hsl<T>
[src]
fn sub(self, other: Hsl<T>) -> Hsl<T>
Performs the -
operation.
impl<T> Sub<T> for Hsl<T> where
T: Float,
[src]
impl<T> Sub<T> for Hsl<T> where
T: Float,
type Output = Hsl<T>
The resulting type after applying the -
operator.
fn sub(self, c: T) -> Hsl<T>
[src]
fn sub(self, c: T) -> Hsl<T>
Performs the -
operation.
impl<T> Clone for Hsl<T> where
T: Clone + Float,
[src]
impl<T> Clone for Hsl<T> where
T: Clone + Float,
fn clone(&self) -> Hsl<T>
[src]
fn clone(&self) -> Hsl<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> Default for Hsl<T> where
T: Float,
[src]
impl<T> Default for Hsl<T> where
T: Float,
impl<T> Debug for Hsl<T> where
T: Debug + Float,
[src]
impl<T> Debug for Hsl<T> where
T: Debug + Float,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<T> Copy for Hsl<T> where
T: Copy + Float,
[src]
impl<T> Copy for Hsl<T> where
T: Copy + Float,
impl<T> FromColor<T> for Hsl<T> where
T: Float,
[src]
impl<T> FromColor<T> for Hsl<T> where
T: Float,
fn from_xyz(xyz: Xyz<T>) -> Hsl<T>
[src]
fn from_xyz(xyz: Xyz<T>) -> Hsl<T>
Convert from XYZ color space
fn from_rgb(rgb: Rgb<T>) -> Hsl<T>
[src]
fn from_rgb(rgb: Rgb<T>) -> Hsl<T>
Convert from RGB color space
fn from_hsl(hsl: Hsl<T>) -> Hsl<T>
[src]
fn from_hsl(hsl: Hsl<T>) -> Hsl<T>
Convert from HSL color space
fn from_hsv(hsv: Hsv<T>) -> Hsl<T>
[src]
fn from_hsv(hsv: Hsv<T>) -> Hsl<T>
Convert from HSV color space
fn from_yxy(inp: Yxy<T>) -> Self
[src]
fn from_yxy(inp: Yxy<T>) -> Self
Convert from Yxy color space
fn from_lab(inp: Lab<T>) -> Self
[src]
fn from_lab(inp: Lab<T>) -> Self
Convert from Lab* color space
fn from_lch(inp: Lch<T>) -> Self
[src]
fn from_lch(inp: Lch<T>) -> Self
Convert from LCh° color space
fn from_hwb(inp: Hwb<T>) -> Self
[src]
fn from_hwb(inp: Hwb<T>) -> Self
Convert from HWB color space
fn from_luma(inp: Luma<T>) -> Self
[src]
fn from_luma(inp: Luma<T>) -> Self
Convert from Luma
impl<T> PartialEq<Hsl<T>> for Hsl<T> where
T: PartialEq<T> + Float,
[src]
impl<T> PartialEq<Hsl<T>> for Hsl<T> where
T: PartialEq<T> + Float,
fn eq(&self, other: &Hsl<T>) -> bool
[src]
fn eq(&self, other: &Hsl<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Hsl<T>) -> bool
[src]
fn ne(&self, other: &Hsl<T>) -> bool
This method tests for !=
.
impl<T> Limited for Hsl<T> where
T: Float,
[src]
impl<T> Limited for Hsl<T> where
T: Float,
fn is_valid(&self) -> bool
[src]
fn is_valid(&self) -> bool
Check if the color's components are within the expected ranges.
fn clamp(&self) -> Hsl<T>
[src]
fn clamp(&self) -> Hsl<T>
Return a new color where the components has been clamped to the nearest valid values. Read more
fn clamp_self(&mut self)
[src]
fn clamp_self(&mut self)
Clamp the color's components to the nearest valid values.
impl<T> From<Hsv<T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Hsv<T>> for Hsl<T> where
T: Float,
impl<T> From<Lab<T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Lab<T>> for Hsl<T> where
T: Float,
impl<T> From<Hwb<T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Hwb<T>> for Hsl<T> where
T: Float,
impl<T> From<Hsl<T>> for Alpha<Xyz<T>, T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Alpha<Xyz<T>, T> where
T: Float,
impl<T> From<Alpha<Yxy<T>, T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Alpha<Yxy<T>, T>> for Hsl<T> where
T: Float,
impl<T> From<Alpha<Hsv<T>, T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Alpha<Hsv<T>, T>> for Hsl<T> where
T: Float,
impl<T> From<Hsl<T>> for Xyz<T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Xyz<T> where
T: Float,
impl<T> From<Hsl<T>> for Alpha<Luma<T>, T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Alpha<Luma<T>, T> where
T: Float,
impl<T> From<Alpha<Lab<T>, T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Alpha<Lab<T>, T>> for Hsl<T> where
T: Float,
impl<T> From<Yxy<T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Yxy<T>> for Hsl<T> where
T: Float,
impl<T> From<Hsl<T>> for Alpha<Hwb<T>, T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Alpha<Hwb<T>, T> where
T: Float,
impl<T> From<Hsl<T>> for Alpha<Rgb<T>, T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Alpha<Rgb<T>, T> where
T: Float,
impl<T> From<Hsl<T>> for Alpha<Lch<T>, T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Alpha<Lch<T>, T> where
T: Float,
impl<T> From<Alpha<Luma<T>, T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Alpha<Luma<T>, T>> for Hsl<T> where
T: Float,
impl<T> From<Alpha<Xyz<T>, T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Alpha<Xyz<T>, T>> for Hsl<T> where
T: Float,
impl<T> From<Hsl<T>> for Hwb<T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Hwb<T> where
T: Float,
impl<T> From<Alpha<Hsl<T>, T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Alpha<Hsl<T>, T>> for Hsl<T> where
T: Float,
impl<T> From<Hsl<T>> for Rgb<T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Rgb<T> where
T: Float,
impl<T> From<Xyz<T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Xyz<T>> for Hsl<T> where
T: Float,
impl<T> From<Alpha<Rgb<T>, T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Alpha<Rgb<T>, T>> for Hsl<T> where
T: Float,
impl<T> From<Hsl<T>> for Alpha<Lab<T>, T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Alpha<Lab<T>, T> where
T: Float,
impl<T> From<Hsl<T>> for Hsv<T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Hsv<T> where
T: Float,
impl<T> From<Hsl<T>> for Alpha<Hsv<T>, T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Alpha<Hsv<T>, T> where
T: Float,
impl<T> From<Hsl<T>> for Yxy<T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Yxy<T> where
T: Float,
impl<T> From<Hsl<T>> for Luma<T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Luma<T> where
T: Float,
impl<T> From<Hsl<T>> for Color<T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Color<T> where
T: Float,
impl<T> From<Alpha<Hwb<T>, T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Alpha<Hwb<T>, T>> for Hsl<T> where
T: Float,
impl<T> From<Luma<T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Luma<T>> for Hsl<T> where
T: Float,
impl<T> From<Alpha<Lch<T>, T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Alpha<Lch<T>, T>> for Hsl<T> where
T: Float,
impl<T> From<Hsl<T>> for Lch<T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Lch<T> where
T: Float,
impl<T> From<Rgb<T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Rgb<T>> for Hsl<T> where
T: Float,
impl<T> From<Hsl<T>> for Alpha<Yxy<T>, T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Alpha<Yxy<T>, T> where
T: Float,
impl<T> From<Hsl<T>> for Lab<T> where
T: Float,
[src]
impl<T> From<Hsl<T>> for Lab<T> where
T: Float,
impl<T> From<Lch<T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Lch<T>> for Hsl<T> where
T: Float,
impl<T> From<Color<T>> for Hsl<T> where
T: Float,
[src]
impl<T> From<Color<T>> for Hsl<T> where
T: Float,
impl<T> IntoColor<T> for Hsl<T> where
T: Float,
[src]
impl<T> IntoColor<T> for Hsl<T> where
T: Float,
fn into_xyz(self) -> Xyz<T>
[src]
fn into_xyz(self) -> Xyz<T>
Convert into XYZ space
fn into_yxy(self) -> Yxy<T>
[src]
fn into_yxy(self) -> Yxy<T>
Convert into Yxy color space
fn into_lab(self) -> Lab<T>
[src]
fn into_lab(self) -> Lab<T>
Convert into Lab* color space
fn into_lch(self) -> Lch<T>
[src]
fn into_lch(self) -> Lch<T>
Convert into LCh° color space
fn into_rgb(self) -> Rgb<T>
[src]
fn into_rgb(self) -> Rgb<T>
Convert into RGB color space.
fn into_hsl(self) -> Hsl<T>
[src]
fn into_hsl(self) -> Hsl<T>
Convert into HSL color space
fn into_hsv(self) -> Hsv<T>
[src]
fn into_hsv(self) -> Hsv<T>
Convert into HSV color space
fn into_luma(self) -> Luma<T>
[src]
fn into_luma(self) -> Luma<T>
Convert into Luma
fn into_hwb(self) -> Hwb<T>
[src]
fn into_hwb(self) -> Hwb<T>
Convert into HWB color space
impl<S> IntoRgba<S> for Hsl<S> where
S: Float + One,
[src]
impl<S> IntoRgba<S> for Hsl<S> where
S: Float + One,