#[repr(C)]pub struct Hsl<ComponentTy = f32> {
pub h: ComponentTy,
pub s: ComponentTy,
pub l: ComponentTy,
}Expand description
A color in the HSL color space.
Since HSL is a relative color space, it is required to know the RGB space which it was transformed from. We define this as the linear sRGB space, as that is the most common case.
Fields§
§h: ComponentTyThe H (hue) component. Varies from 0 to 1.
s: ComponentTyThe S (saturation) component. Varies from 0 to 1.
l: ComponentTyThe L (lightness) component. Varies from 0 to 1.
Trait Implementations§
Source§impl<ComponentTy> AsMut<[ComponentTy; 3]> for Hsl<ComponentTy>
impl<ComponentTy> AsMut<[ComponentTy; 3]> for Hsl<ComponentTy>
Source§fn as_mut(&mut self) -> &mut [ComponentTy; 3]
fn as_mut(&mut self) -> &mut [ComponentTy; 3]
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl<ComponentTy> AsRef<[ComponentTy; 3]> for Hsl<ComponentTy>
impl<ComponentTy> AsRef<[ComponentTy; 3]> for Hsl<ComponentTy>
Source§fn as_ref(&self) -> &[ComponentTy; 3]
fn as_ref(&self) -> &[ComponentTy; 3]
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<ComponentTy> From<[ComponentTy; 3]> for Hsl<ComponentTy>
impl<ComponentTy> From<[ComponentTy; 3]> for Hsl<ComponentTy>
Source§fn from([h, s, l]: [ComponentTy; 3]) -> Hsl<ComponentTy>
fn from([h, s, l]: [ComponentTy; 3]) -> Hsl<ComponentTy>
Converts to this type from the input type.
Source§impl<ComponentTy> Into<[ComponentTy; 3]> for Hsl<ComponentTy>
impl<ComponentTy> Into<[ComponentTy; 3]> for Hsl<ComponentTy>
Source§fn into(self) -> [ComponentTy; 3]
fn into(self) -> [ComponentTy; 3]
Converts this type into the (usually inferred) input type.
Source§impl<ComponentTy: Ord> Ord for Hsl<ComponentTy>
impl<ComponentTy: Ord> Ord for Hsl<ComponentTy>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<ComponentTy: PartialOrd> PartialOrd for Hsl<ComponentTy>
impl<ComponentTy: PartialOrd> PartialOrd for Hsl<ComponentTy>
impl<ComponentTy: Copy> Copy for Hsl<ComponentTy>
impl<ComponentTy: Eq> Eq for Hsl<ComponentTy>
impl<ComponentTy: Pod> Pod for Hsl<ComponentTy>
impl<ComponentTy> StructuralPartialEq for Hsl<ComponentTy>
Auto Trait Implementations§
impl<ComponentTy> Freeze for Hsl<ComponentTy>where
ComponentTy: Freeze,
impl<ComponentTy> RefUnwindSafe for Hsl<ComponentTy>where
ComponentTy: RefUnwindSafe,
impl<ComponentTy> Send for Hsl<ComponentTy>where
ComponentTy: Send,
impl<ComponentTy> Sync for Hsl<ComponentTy>where
ComponentTy: Sync,
impl<ComponentTy> Unpin for Hsl<ComponentTy>where
ComponentTy: Unpin,
impl<ComponentTy> UnwindSafe for Hsl<ComponentTy>where
ComponentTy: UnwindSafe,
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.