Struct colorsys::Hsl

source ·
pub struct Hsl { /* private fields */ }
Expand description

The HSL or HSI (hue, saturation, lightness (intensity)) color model

Ranges:

  • hue: 0.0 - 360.0
  • saturation: 0.0 - 100.0
  • saturation: 0.0 - 100.0
  • alpha: 0.0 - 1.0

Implementations§

👎Deprecated since 0.7.0: Please use hue instead
👎Deprecated since 0.7.0: Please use saturation instead
👎Deprecated since 0.7.0: Please use lightness instead

Returns an iterator over three color units and the possibly alpha value.

Returns an HSL representation with values converted to floar from 0.0 to 1.0

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
Performs the += operation. Read more
Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Makes color lighter or (if amt is negative) darker. Amt is percent - 1..100 to make color lighter; -100..-1 for blacking-out
Saturate/desaturate color. Value is percent: -100..100. You need specify in what color space you want to increase/decrease saturation.
increase/decrease color tone. Value is degree - -360..360.
Brings color to a shade of gray. For more specific grayscale methods see Rgb.grayscale
Just inverts color
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Example
use colorsys::{Rgb,Hsl,prelude::*};
let hsl = Hsl::from(&(48.0, 70.0, 50.0));
let rgb: Rgb = Rgb::from(&hsl);
assert_eq!(rgb.to_css_string(), "rgb(217,181,38)");
Converts to this type from the input type.
Example
use colorsys::{Rgb,Hsl,prelude::*};
let rgb = Rgb::from(&(215.0, 231.0, 236.0));
let hsl = Hsl::from(&rgb);
assert_eq!(hsl.to_css_string(), "hsl(194,36%,88%)");
Example
use colorsys::{Rgb,Hsl,prelude::*};
let mut hsl = Hsl::from(&(359.0, 33.0, 77.0));
let rgb_string = Rgb::from(&mut hsl).to_css_string();
assert_eq!(rgb_string, "rgb(216,177,178)");
Converts to this type from the input type.
Example
use colorsys::{Rgb,Hsl,prelude::*};
let mut rgb = Rgb::from(&(0.0, 0.0, 0.0));
let hsl_string = Hsl::from(&mut rgb).to_css_string();
assert_eq!(hsl_string, "hsl(0,0%,0%)");
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Example
use colorsys::{Rgb,Hsl,prelude::*};
let hsl = Hsl::from(&(192.0, 67.0, 28.0));
let rgb_string = Rgb::from(hsl).to_css_string();
assert_eq!(rgb_string, "rgb(24,100,119)");
Converts to this type from the input type.
Example
use colorsys::{Rgb,Hsl,prelude::*};
let rgb = Rgb::from(&(255.0, 255.0, 255.0));
let hsl_string = Hsl::from(rgb).to_css_string();
assert_eq!(hsl_string, "hsl(0,0%,100%)");
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
Performs the -= operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.