pub struct ColorHsv {
pub h: f32,
pub s: f32,
pub v: f32,
}
Expand description
A color represented in HSV (Hue, Saturation, Value) format.
- Hue (h): Angle in degrees [0-360] representing the color
- Saturation (s): Amount of color [0-1]
- Value (v): Brightness [0-1]
§Example
let red_hsv = ColorRgb::red().hsv();
let red_rgb = red_hsv.rgb();
Fields§
§h: f32
§s: f32
§v: f32
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ColorHsv
impl<'de> Deserialize<'de> for ColorHsv
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 Copy for ColorHsv
Auto Trait Implementations§
impl Freeze for ColorHsv
impl RefUnwindSafe for ColorHsv
impl Send for ColorHsv
impl Sync for ColorHsv
impl Unpin for ColorHsv
impl UnwindSafe for ColorHsv
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§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