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