#[repr(C)]pub struct Hsl {
pub h: f32,
pub s: f32,
pub l: f32,
}Expand description
Represents HSL (hue, saturation, lightness) colorspace, H ∈ [0, 360f32], s ∈ [0f32, 1f32], v ∈ [0f32, 1f32]
Fields§
§h: f32Hue H ∈ [0, 360f32]
s: f32Saturation s ∈ [0, 1f32]
l: f32Lightness v ∈ [0, 1f32]
Implementations§
source§impl Hsl
impl Hsl
pub fn new(h: u16, s: u16, l: u16) -> Hsl
pub fn from_components(h: f32, s: f32, l: f32) -> Hsl
pub fn from_rgb(rgb: Rgb<u8>) -> Hsl
pub fn to_rgb8(&self) -> Rgb<u8>
pub fn to_rgb(&self) -> Rgb<u8>
pub fn get_saturation(&self) -> u16
pub fn get_lightness(&self) -> u16
pub fn get_hue(&self) -> u16
Trait Implementations§
source§impl PartialOrd for Hsl
impl PartialOrd for Hsl
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more