[][src]Struct colorsys::Hsl

pub struct Hsl { /* fields omitted */ }

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

Methods

impl Hsl[src]

pub fn new(h: f64, s: f64, l: f64, a: Option<f64>) -> Hsl[src]

pub fn to_css_string(&self) -> String[src]

pub fn get_hue(&self) -> f64[src]

pub fn get_saturation(&self) -> f64[src]

pub fn get_lightness(&self) -> f64[src]

pub fn set_hue(&mut self, val: f64)[src]

pub fn set_saturation(&mut self, val: f64)[src]

pub fn set_lightness(&mut self, val: f64)[src]

pub fn iter(&self) -> ColorIter[src]

Trait Implementations

impl ApproxEq<Hsl> for Hsl[src]

impl ApproxEq<Rgb> for Hsl[src]

impl ApproxEq<Hsl> for Rgb[src]

impl ColorAlpha for Hsl[src]

impl ColorTransform for Hsl[src]

impl<'a> Into<(f64, f64, f64)> for &'a mut Hsl[src]

impl<'a> Into<(f64, f64, f64)> for &'a Hsl[src]

impl Into<(f64, f64, f64)> for Hsl[src]

impl<'a> Into<(f64, f64, f64, f64)> for &'a Hsl[src]

impl<'a> Into<(f64, f64, f64, f64)> for &'a mut Hsl[src]

impl Into<(f64, f64, f64, f64)> for Hsl[src]

impl Default for Hsl[src]

impl PartialEq<Hsl> for Hsl[src]

impl<'_> From<&'_ (f64, f64, f64)> for Hsl[src]

impl From<(f64, f64, f64)> for Hsl[src]

impl<'_> From<&'_ (f64, f64, f64, f64)> for Hsl[src]

impl From<(f64, f64, f64, f64)> for Hsl[src]

impl<'_> From<&'_ Rgb> for Hsl[src]

fn from(rgb: &Rgb) -> Self[src]

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)");

impl<'_> From<&'_ mut Rgb> for Hsl[src]

fn from(rgb: &mut Rgb) -> Self[src]

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)");

impl From<Rgb> for Hsl[src]

fn from(rgb: Rgb) -> Self[src]

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)");

impl<'_> From<&'_ Hsl> for Rgb[src]

fn from(hsl: &Hsl) -> Self[src]

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)");

impl<'_> From<&'_ mut Hsl> for Rgb[src]

fn from(hsl: &mut Hsl) -> Self[src]

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)");

impl From<Hsl> for Rgb[src]

fn from(hsl: Hsl) -> Self[src]

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)");

impl AsRef<Hsl> for Hsl[src]

impl Clone for Hsl[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> IntoIterator for &'a Hsl[src]

type Item = f64

The type of the elements being iterated over.

type IntoIter = ColorIter

Which kind of iterator are we turning this into?

impl IntoIterator for Hsl[src]

type Item = f64

The type of the elements being iterated over.

type IntoIter = ColorIter

Which kind of iterator are we turning this into?

impl Debug for Hsl[src]

impl<'a> Add<&'a Hsl> for &'a Hsl[src]

type Output = Hsl

The resulting type after applying the + operator.

impl<'a> Add<&'a mut Hsl> for &'a mut Hsl[src]

type Output = Hsl

The resulting type after applying the + operator.

impl Add<Hsl> for Hsl[src]

type Output = Hsl

The resulting type after applying the + operator.

impl Sub<Hsl> for Hsl[src]

type Output = Hsl

The resulting type after applying the - operator.

impl<'a> Sub<&'a Hsl> for &'a Hsl[src]

type Output = Hsl

The resulting type after applying the - operator.

impl<'a> Sub<&'a mut Hsl> for &'a mut Hsl[src]

type Output = Hsl

The resulting type after applying the - operator.

impl AddAssign<Hsl> for Hsl[src]

impl SubAssign<Hsl> for Hsl[src]

impl FromStr for Hsl[src]

type Err = ParseError

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Send for Hsl

impl Sync for Hsl

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.