#[repr(C)]pub struct Hsv {
pub h: f32,
pub s: f32,
pub v: f32,
}Expand description
Represents HSV (hue, saturation, value) colorspace, H ∈ [0, 360f32], s ∈ [0f32, 1f32], v ∈ [0f32, 1f32]
Fields§
§h: f32Hue H ∈ [0, 360f32]
s: f32Saturation s ∈ [0, 1f32]
v: f32Value v ∈ [0, 1f32]
Implementations§
Source§impl Hsv
impl Hsv
pub fn new(h: u16, s: u16, l: u16) -> Hsv
pub fn from_components(h: f32, s: f32, v: f32) -> Hsv
pub fn from(rgb: Rgb<u8>) -> Hsv
pub fn to_rgb8(&self) -> Rgb<u8>
pub fn get_hue(&self) -> f32
pub fn get_saturation(&self) -> f32
pub fn get_value(&self) -> f32
pub fn get_hue_p(&self) -> u16
pub fn get_saturation_p(&self) -> u16
pub fn get_value_p(&self) -> u16
Trait Implementations§
Source§impl PartialOrd for Hsv
impl PartialOrd for Hsv
impl Copy for Hsv
impl StructuralPartialEq for Hsv
Auto Trait Implementations§
impl Freeze for Hsv
impl RefUnwindSafe for Hsv
impl Send for Hsv
impl Sync for Hsv
impl Unpin for Hsv
impl UnwindSafe for Hsv
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more