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

The hue of the color, in degrees. Decides if it's red, blue, purple, etc.

The colorfulness of the color. 0.0 gives gray scale colors and 1.0 will give absolutely clear colors.

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]

[src]

Linear HSL.

Trait Implementations

impl<T> Default for Hsl<T> where
    T: Float
[src]

[src]

Returns the "default value" for a type. Read more

impl<T> Shade for Hsl<T> where
    T: Float
[src]

The type of the lighten/darken amount.

[src]

Lighten the color by amount.

[src]

Darken the color by amount.

impl<T> Sub<Hsl<T>> for Hsl<T> where
    T: Float
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl<T> Sub<T> for Hsl<T> where
    T: Float
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl<T> Mix for Hsl<T> where
    T: Float
[src]

The type of the mixing factor.

[src]

Mix the color with an other color, by factor. Read more

impl<T> Saturate for Hsl<T> where
    T: Float
[src]

The type of the (de)saturation factor.

[src]

Increase the saturation by factor.

[src]

Decrease the saturation by factor.

impl<T> Hue for Hsl<T> where
    T: Float
[src]

[src]

Return a new copy of self, but with a specific hue.

[src]

Return a new copy of self, but with the hue shifted by amount.

impl<T> ApproxEq for Hsl<T> where
    T: ApproxEq + Float,
    <T as ApproxEq>::Epsilon: Copy,
    <T as ApproxEq>::Epsilon: Float
[src]

Used for specifying relative comparisons.

[src]

The default tolerance to use when testing values that are close together. Read more

[src]

The default relative tolerance for testing values that are far-apart. Read more

[src]

The default ULPs to tolerate when testing values that are far-apart. Read more

[src]

A test for equality that uses a relative comparison if the values are far apart.

[src]

A test for equality that uses units in the last place (ULP) if the values are far apart.

[src]

The inverse of ApproxEq::relative_eq.

[src]

The inverse of ApproxEq::ulps_eq.

impl<T> GetHue for Hsl<T> where
    T: Float
[src]

The kind of hue unit this color space uses. Read more

[src]

Calculate a hue if possible. Read more

impl<T> Copy for Hsl<T> where
    T: Copy + Float
[src]

impl<T> PartialEq<Hsl<T>> for Hsl<T> where
    T: PartialEq<T> + Float
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T> From<Hsl<T>> for Hwb<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Lab<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Alpha<Lab<T>, T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Alpha<Lch<T>, T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Alpha<Hsv<T>, T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Luma<T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Alpha<Hwb<T>, T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Alpha<Yxy<T>, T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hwb<T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Color<T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsv<T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Yxy<T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Lab<T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Alpha<Xyz<T>, T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Alpha<Lab<T>, T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Hsv<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Alpha<Xyz<T>, T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Lch<T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Alpha<Hwb<T>, T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Alpha<Luma<T>, T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Alpha<Rgb<T>, T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Alpha<Luma<T>, T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Rgb<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Lch<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Luma<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Alpha<Hsl<T>, T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Alpha<Hsv<T>, T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Color<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Alpha<Lch<T>, T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Alpha<Yxy<T>, T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Alpha<Rgb<T>, T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Xyz<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Hsl<T>> for Yxy<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Xyz<T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> From<Rgb<T>> for Hsl<T> where
    T: Float
[src]

[src]

Performs the conversion.

impl<T> FromColor<T> for Hsl<T> where
    T: Float
[src]

[src]

Convert from XYZ color space

[src]

Convert from RGB color space

[src]

Convert from HSL color space

[src]

Convert from HSV color space

[src]

Convert from Yxy color space

[src]

Convert from Lab* color space

[src]

Convert from LCh° color space

[src]

Convert from HWB color space

[src]

Convert from Luma

impl<T> Clone for Hsl<T> where
    T: Clone + Float
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Add<T> for Hsl<T> where
    T: Float
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl<T> Add<Hsl<T>> for Hsl<T> where
    T: Float
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl<T> Limited for Hsl<T> where
    T: Float
[src]

[src]

Check if the color's components are within the expected ranges.

[src]

Return a new color where the components has been clamped to the nearest valid values. Read more

[src]

Clamp the color's components to the nearest valid values.

impl<T> IntoColor<T> for Hsl<T> where
    T: Float
[src]

[src]

Convert into XYZ space

[src]

Convert into Yxy color space

[src]

Convert into Lab* color space

[src]

Convert into LCh° color space

[src]

Convert into RGB color space.

[src]

Convert into HSL color space

[src]

Convert into HSV color space

[src]

Convert into Luma

[src]

Convert into HWB color space

impl<T> Debug for Hsl<T> where
    T: Debug + Float
[src]

[src]

Formats the value using the given formatter. Read more

impl<S> IntoRgba<S> for Hsl<S> where
    S: Float + One
[src]

[src]

Convert self into RGBA.

Auto Trait Implementations

impl<T> Send for Hsl<T> where
    T: Send

impl<T> Sync for Hsl<T> where
    T: Sync