pub struct Hsl {
pub hue: f32,
pub saturation: f32,
pub lightness: f32,
pub alpha: f32,
}
Expand description
An colour represented as Hue, Saturation, and Lightness expressed in the sRGB colour space. The components are:
- Hue - a number between 0.0 and 360.0
- Saturation - a number between 0.0 and 100.0
- Brightness - a number between 0.0 and 100.0
- Alpha - a number between 0.0 and 100.0
Fields§
§hue: f32
§saturation: f32
§lightness: f32
§alpha: f32
Implementations§
Trait Implementations§
Source§impl<T, U> ColorMixPolar<T, U> for Hsl
impl<T, U> ColorMixPolar<T, U> for Hsl
fn mix_polar( first: T, second: U, percentage: f64, hue_interpolation: HueInterpolation, ) -> Self
impl Copy for Hsl
impl StructuralPartialEq for Hsl
Auto Trait Implementations§
impl Freeze for Hsl
impl RefUnwindSafe for Hsl
impl Send for Hsl
impl Sync for Hsl
impl Unpin for Hsl
impl UnwindSafe for Hsl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C, T> ColorDistance<T> for C
impl<C, T> ColorDistance<T> for C
Source§impl<C, T> WcagColorContrast<T> for C
impl<C, T> WcagColorContrast<T> for C
Source§fn wcag_contrast_ratio(&self, other: T) -> f64
fn wcag_contrast_ratio(&self, other: T) -> f64
Calculate the contrast ratio between
self
and other
. colors according to WCAG 2.1. Returns a value between
1:1 and 21:1 Read more