pub struct Hsl {
pub hue: Angle,
pub saturation: Ratio,
pub lightness: Ratio,
pub alpha: Ratio,
}Expand description
A color in the HSL (Hue, Saturation, Lightness) color space.
Fields§
§hue: AngleThe hue component of the color.
saturation: RatioThe saturation component of the color.
lightness: RatioThe lightness component of the color.
alpha: RatioThe alpha (transparency) component of the color.
Implementations§
Source§impl Hsl
impl Hsl
Sourcepub const fn new(
hue: Angle,
saturation: Ratio,
lightness: Ratio,
alpha: Ratio,
) -> Self
pub const fn new( hue: Angle, saturation: Ratio, lightness: Ratio, alpha: Ratio, ) -> Self
Creates a new Hsl color with the given hue, saturation, lightness, and alpha components.
§Examples
use typwire::{Angle, Hsl, Ratio};
let h = Hsl::new(
Angle::new(0.0),
Ratio::new(1.0),
Ratio::new(0.5),
Ratio::new(1.0),
);
assert_eq!(h.saturation, Ratio::new(1.0));Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hsl
impl<'de> Deserialize<'de> for Hsl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)