pub struct ColorHSLA { /* private fields */ }Expand description
A struct for defining a single color in HSLA space all values are between 0 and 1
Implementations§
Source§impl ColorHSLA
impl ColorHSLA
Sourcepub fn new(h: f32, s: f32, l: f32, a: f32) -> Self
pub fn new(h: f32, s: f32, l: f32, a: f32) -> Self
Constructs a new hsla color, all values are clamped to between 0 and 1
§Parameters
h: The hue component
s: The saturation component
l: The lightness component
a: The alpha component
Sourcepub fn new_hsl(h: f32, s: f32, l: f32) -> Self
pub fn new_hsl(h: f32, s: f32, l: f32) -> Self
Constructs a new hsla color with the alpha component equal to 1, all values are clamped to between 0 and 1
§Parameters
h: The hue component
s: The saturation component
l: The ligness component
Sourcepub unsafe fn new_unsafe(h: f32, s: f32, l: f32, a: f32) -> Self
pub unsafe fn new_unsafe(h: f32, s: f32, l: f32, a: f32) -> Self
Constructs a new hsla color without validating the input
§Parameters
h: The hue component
s: The saturation component
l: The lightness component
a: The alpha component
Sourcepub fn get_saturation(&self) -> f32
pub fn get_saturation(&self) -> f32
Retrieves the saturation component of the color
Sourcepub fn get_lightness(&self) -> f32
pub fn get_lightness(&self) -> f32
Retrieves the lightness component of the color
Trait Implementations§
Source§impl Color for ColorHSLA
impl Color for ColorHSLA
Source§impl PartialOrd for ColorHSLA
impl PartialOrd for ColorHSLA
impl Copy for ColorHSLA
impl StructuralPartialEq for ColorHSLA
Auto Trait Implementations§
impl Freeze for ColorHSLA
impl RefUnwindSafe for ColorHSLA
impl Send for ColorHSLA
impl Sync for ColorHSLA
impl Unpin for ColorHSLA
impl UnwindSafe for ColorHSLA
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