Struct colorsys::Hsl [−][src]
The HSL or HSI (hue, saturation, lightness (intensity)) color model
Ranges:
- h (hue): 0.0 - 360.0
- s (saturation): 0.0 - 100.0
- l (saturation): 0.0 - 100.0
- a (alpha): 0.0 - 1.0
Implementations
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 hue(&self) -> f64
[src]
pub fn saturation(&self) -> f64
[src]
pub fn lightness(&self) -> f64
[src]
pub fn get_hue(&self) -> f64
[src]
Please use hue
instead
pub fn get_saturation(&self) -> f64
[src]
Please use saturation
instead
pub fn get_lightness(&self) -> f64
[src]
Please use lightness
instead
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]
pub fn as_ratio(&self) -> HslRatio
[src]
Trait Implementations
impl<'a> Add<&'a Hsl> for &'a Hsl
[src]
type Output = Hsl
The resulting type after applying the +
operator.
fn add(self, rhs: &Hsl) -> Hsl
[src]
impl<'a> Add<&'a mut Hsl> for &'a mut Hsl
[src]
type Output = Hsl
The resulting type after applying the +
operator.
fn add(self, rhs: &'a mut Hsl) -> Hsl
[src]
impl Add<Hsl> for Hsl
[src]
type Output = Hsl
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl AddAssign<Hsl> for Hsl
[src]
fn add_assign(&mut self, rhs: Self)
[src]
impl ApproxEq<Hsl> for Hsl
[src]
fn approx_eq(&self, other: &Hsl) -> bool
[src]
fn approx_eq_clarify(&self, other: &Hsl, precision: f64) -> bool
[src]
impl ApproxEq<Hsl> for Rgb
[src]
fn approx_eq(&self, hsl: &Hsl) -> bool
[src]
fn approx_eq_clarify(&self, hsl: &Hsl, precision: f64) -> bool
[src]
impl ApproxEq<Rgb> for Hsl
[src]
fn approx_eq(&self, rgb: &Rgb) -> bool
[src]
fn approx_eq_clarify(&self, rgb: &Rgb, precision: f64) -> bool
[src]
impl AsRef<Hsl> for Hsl
[src]
impl Clone for Hsl
[src]
impl ColorAlpha for Hsl
[src]
fn get_alpha(&self) -> f64
[src]
fn set_alpha(&mut self, val: f64)
[src]
fn opacify(&mut self, val: f64)
[src]
impl ColorTransform for Hsl
[src]
fn lighten(&mut self, amt: f64)
[src]
fn saturate(&mut self, sat: SaturationInSpace)
[src]
fn adjust_hue(&mut self, hue: f64)
[src]
fn grayscale_simple(&mut self)
[src]
fn invert(&mut self)
[src]
impl Debug for Hsl
[src]
impl Default for Hsl
[src]
impl From<&'_ [f32; 3]> for Hsl
[src]
impl From<&'_ [f32; 4]> for Hsl
[src]
impl From<&'_ [f64; 3]> for Hsl
[src]
impl From<&'_ [f64; 4]> for Hsl
[src]
impl From<&'_ [i16; 3]> for Hsl
[src]
impl From<&'_ [i32; 3]> for Hsl
[src]
impl From<&'_ [i64; 3]> for Hsl
[src]
impl From<&'_ [u16; 3]> for Hsl
[src]
impl From<&'_ [u32; 3]> for Hsl
[src]
impl From<&'_ [u64; 3]> for Hsl
[src]
impl From<&'_ (f32, f32, f32, f32)> for Hsl
[src]
impl From<&'_ (f32, f32, f32)> for Hsl
[src]
impl From<&'_ (f64, f64, f64, f64)> for Hsl
[src]
impl From<&'_ (f64, f64, f64)> for Hsl
[src]
impl From<&'_ (i16, i16, i16)> for Hsl
[src]
impl From<&'_ (i32, i32, i32)> for Hsl
[src]
impl From<&'_ (i64, i64, i64)> for Hsl
[src]
impl From<&'_ (u16, u16, u16)> for Hsl
[src]
impl From<&'_ (u32, u32, u32)> for Hsl
[src]
impl From<&'_ (u64, u64, u64)> for Hsl
[src]
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<&'_ HslRatio> 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 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<&'_ mut HslRatio> for Hsl
[src]
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<[f32; 3]> for Hsl
[src]
impl From<[f32; 4]> for Hsl
[src]
impl From<[f64; 3]> for Hsl
[src]
impl From<[f64; 4]> for Hsl
[src]
impl From<[i16; 3]> for Hsl
[src]
impl From<[i32; 3]> for Hsl
[src]
impl From<[i64; 3]> for Hsl
[src]
impl From<[u16; 3]> for Hsl
[src]
impl From<[u32; 3]> for Hsl
[src]
impl From<[u64; 3]> for Hsl
[src]
impl From<(f32, f32, f32, f32)> for Hsl
[src]
impl From<(f32, f32, f32)> for Hsl
[src]
impl From<(f64, f64, f64, f64)> for Hsl
[src]
impl From<(f64, f64, f64)> for Hsl
[src]
impl From<(i16, i16, i16)> for Hsl
[src]
impl From<(i32, i32, i32)> for Hsl
[src]
impl From<(i64, i64, i64)> for Hsl
[src]
impl From<(u16, u16, u16)> for Hsl
[src]
impl From<(u32, u32, u32)> for Hsl
[src]
impl From<(u64, u64, u64)> for Hsl
[src]
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 From<HslRatio> 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(&(255.0, 255.0, 255.0)); let hsl_string = Hsl::from(rgb).to_css_string(); assert_eq!(hsl_string, "hsl(0,0%,100%)");
impl FromStr for Hsl
[src]
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Hsl, ParseError>
[src]
impl<'a> Into<[f32; 3]> for &'a Hsl
[src]
impl<'a> Into<[f32; 3]> for &'a mut Hsl
[src]
impl Into<[f32; 3]> for Hsl
[src]
impl<'a> Into<[f32; 4]> for &'a Hsl
[src]
impl<'a> Into<[f32; 4]> for &'a mut Hsl
[src]
impl Into<[f32; 4]> for Hsl
[src]
impl<'a> Into<[f64; 3]> for &'a Hsl
[src]
impl<'a> Into<[f64; 3]> for &'a mut Hsl
[src]
impl Into<[f64; 3]> for Hsl
[src]
impl<'a> Into<[f64; 4]> for &'a Hsl
[src]
impl<'a> Into<[f64; 4]> for &'a mut Hsl
[src]
impl Into<[f64; 4]> for Hsl
[src]
impl<'a> Into<[i16; 3]> for &'a Hsl
[src]
impl<'a> Into<[i16; 3]> for &'a mut Hsl
[src]
impl Into<[i16; 3]> for Hsl
[src]
impl<'a> Into<[i32; 3]> for &'a Hsl
[src]
impl<'a> Into<[i32; 3]> for &'a mut Hsl
[src]
impl Into<[i32; 3]> for Hsl
[src]
impl<'a> Into<[i64; 3]> for &'a Hsl
[src]
impl<'a> Into<[i64; 3]> for &'a mut Hsl
[src]
impl Into<[i64; 3]> for Hsl
[src]
impl<'a> Into<[u16; 3]> for &'a Hsl
[src]
impl<'a> Into<[u16; 3]> for &'a mut Hsl
[src]
impl Into<[u16; 3]> for Hsl
[src]
impl<'a> Into<[u32; 3]> for &'a Hsl
[src]
impl<'a> Into<[u32; 3]> for &'a mut Hsl
[src]
impl Into<[u32; 3]> for Hsl
[src]
impl<'a> Into<[u64; 3]> for &'a Hsl
[src]
impl<'a> Into<[u64; 3]> for &'a mut Hsl
[src]
impl Into<[u64; 3]> for Hsl
[src]
impl<'a> Into<(f32, f32, f32, f32)> for &'a Hsl
[src]
impl<'a> Into<(f32, f32, f32, f32)> for &'a mut Hsl
[src]
impl Into<(f32, f32, f32, f32)> for Hsl
[src]
impl<'a> Into<(f32, f32, f32)> for &'a Hsl
[src]
impl<'a> Into<(f32, f32, f32)> for &'a mut Hsl
[src]
impl Into<(f32, f32, f32)> 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<'a> Into<(f64, f64, f64)> for &'a Hsl
[src]
impl<'a> Into<(f64, f64, f64)> for &'a mut Hsl
[src]
impl Into<(f64, f64, f64)> for Hsl
[src]
impl<'a> Into<(i16, i16, i16)> for &'a Hsl
[src]
impl<'a> Into<(i16, i16, i16)> for &'a mut Hsl
[src]
impl Into<(i16, i16, i16)> for Hsl
[src]
impl<'a> Into<(i32, i32, i32)> for &'a Hsl
[src]
impl<'a> Into<(i32, i32, i32)> for &'a mut Hsl
[src]
impl Into<(i32, i32, i32)> for Hsl
[src]
impl<'a> Into<(i64, i64, i64)> for &'a Hsl
[src]
impl<'a> Into<(i64, i64, i64)> for &'a mut Hsl
[src]
impl Into<(i64, i64, i64)> for Hsl
[src]
impl<'a> Into<(u16, u16, u16)> for &'a Hsl
[src]
impl<'a> Into<(u16, u16, u16)> for &'a mut Hsl
[src]
impl Into<(u16, u16, u16)> for Hsl
[src]
impl<'a> Into<(u32, u32, u32)> for &'a Hsl
[src]
impl<'a> Into<(u32, u32, u32)> for &'a mut Hsl
[src]
impl Into<(u32, u32, u32)> for Hsl
[src]
impl<'a> Into<(u64, u64, u64)> for &'a Hsl
[src]
impl<'a> Into<(u64, u64, u64)> for &'a mut Hsl
[src]
impl Into<(u64, u64, u64)> for Hsl
[src]
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?
fn into_iter(self) -> ColorIterⓘ
[src]
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?
fn into_iter(self) -> ColorIterⓘ
[src]
impl PartialEq<Hsl> for Hsl
[src]
impl StructuralPartialEq for Hsl
[src]
impl<'a> Sub<&'a Hsl> for &'a Hsl
[src]
type Output = Hsl
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Hsl
[src]
impl<'a> Sub<&'a mut Hsl> for &'a mut Hsl
[src]
type Output = Hsl
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Hsl
[src]
impl Sub<Hsl> for Hsl
[src]
type Output = Hsl
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
impl SubAssign<Hsl> for Hsl
[src]
fn sub_assign(&mut self, rhs: Self)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Hsl
[src]
impl Send for Hsl
[src]
impl Sync for Hsl
[src]
impl Unpin for Hsl
[src]
impl UnwindSafe for Hsl
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,