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