Struct nannou::prelude::Hsv
[−]
[src]
pub struct Hsv<T = f32> where
T: Float, { pub hue: RgbHue<T>, pub saturation: T, pub value: T, }
Linear HSV color space.
HSV is a cylindrical version of RGB and it's very
similar to HSL. The difference is that the value
component in HSV determines the brightness of the color, and not the
lightness. The difference is that, for example, red (100% R, 0% G, 0% B)
and white (100% R, 100% G, 100% B) has the same brightness (or value), but
not the same lightness.
Fields
hue: RgbHue<T>
The hue of the color, in degrees. Decides if it's red, blue, purple, etc.
saturation: T
The colorfulness of the color. 0.0 gives gray scale colors and 1.0 will give absolutely clear colors.
value: T
Decides how bright the color will look. 0.0 will be black, and 1.0 will
give a bright an clear color that goes towards white when saturation
goes towards 0.0.
Methods
impl<T> Hsv<T> where
T: Float,
[src]
T: Float,
Trait Implementations
impl<T> Default for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> Shade for Hsv<T> where
T: Float,
[src]
T: Float,
type Scalar = T
The type of the lighten/darken amount.
fn lighten(&self, amount: T) -> Hsv<T>
[src]
Lighten the color by amount
.
fn darken(&self, amount: Self::Scalar) -> Self
[src]
Darken the color by amount
.
impl<T> Sub<T> for Hsv<T> where
T: Float,
[src]
T: Float,
type Output = Hsv<T>
The resulting type after applying the -
operator.
fn sub(self, c: T) -> Hsv<T>
[src]
Performs the -
operation.
impl<T> Sub<Hsv<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
type Output = Hsv<T>
The resulting type after applying the -
operator.
fn sub(self, other: Hsv<T>) -> Hsv<T>
[src]
Performs the -
operation.
impl<T> Mix for Hsv<T> where
T: Float,
[src]
T: Float,
type Scalar = T
The type of the mixing factor.
fn mix(&self, other: &Hsv<T>, factor: T) -> Hsv<T>
[src]
Mix the color with an other color, by factor
. Read more
impl<T> Saturate for Hsv<T> where
T: Float,
[src]
T: Float,
type Scalar = T
The type of the (de)saturation factor.
fn saturate(&self, factor: T) -> Hsv<T>
[src]
Increase the saturation by factor
.
fn desaturate(&self, factor: Self::Scalar) -> Self
[src]
Decrease the saturation by factor
.
impl<T> Hue for Hsv<T> where
T: Float,
[src]
T: Float,
fn with_hue(&self, hue: RgbHue<T>) -> Hsv<T>
[src]
Return a new copy of self
, but with a specific hue.
fn shift_hue(&self, amount: RgbHue<T>) -> Hsv<T>
[src]
Return a new copy of self
, but with the hue shifted by amount
.
impl<T> ApproxEq for Hsv<T> where
T: ApproxEq + Float,
<T as ApproxEq>::Epsilon: Copy,
<T as ApproxEq>::Epsilon: Float,
[src]
T: ApproxEq + Float,
<T as ApproxEq>::Epsilon: Copy,
<T as ApproxEq>::Epsilon: Float,
type Epsilon = <T as ApproxEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> <Hsv<T> as ApproxEq>::Epsilon
[src]
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> <Hsv<T> as ApproxEq>::Epsilon
[src]
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(
&self,
other: &Hsv<T>,
epsilon: <Hsv<T> as ApproxEq>::Epsilon,
max_relative: <Hsv<T> as ApproxEq>::Epsilon
) -> bool
[src]
&self,
other: &Hsv<T>,
epsilon: <Hsv<T> as ApproxEq>::Epsilon,
max_relative: <Hsv<T> as ApproxEq>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(
&self,
other: &Hsv<T>,
epsilon: <Hsv<T> as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
[src]
&self,
other: &Hsv<T>,
epsilon: <Hsv<T> as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(
&self,
other: &Hsv<T>,
epsilon: <Hsv<T> as ApproxEq>::Epsilon,
max_relative: <Hsv<T> as ApproxEq>::Epsilon
) -> bool
[src]
&self,
other: &Hsv<T>,
epsilon: <Hsv<T> as ApproxEq>::Epsilon,
max_relative: <Hsv<T> as ApproxEq>::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(
&self,
other: &Hsv<T>,
epsilon: <Hsv<T> as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
[src]
&self,
other: &Hsv<T>,
epsilon: <Hsv<T> as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
The inverse of ApproxEq::ulps_eq
.
impl<T> GetHue for Hsv<T> where
T: Float,
[src]
T: Float,
type Hue = RgbHue<T>
The kind of hue unit this color space uses. Read more
fn get_hue(&self) -> Option<RgbHue<T>>
[src]
Calculate a hue if possible. Read more
impl<T> Copy for Hsv<T> where
T: Copy + Float,
[src]
T: Copy + Float,
impl<T> PartialEq<Hsv<T>> for Hsv<T> where
T: PartialEq<T> + Float,
[src]
T: PartialEq<T> + Float,
fn eq(&self, __arg_0: &Hsv<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Hsv<T>) -> bool
[src]
This method tests for !=
.
impl<T> From<Hsv<T>> for Alpha<Luma<T>, T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Luma<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Lch<T> where
T: Float,
[src]
T: Float,
impl<T> From<Color<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Lch<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Alpha<Lab<T>, T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Color<T> where
T: Float,
[src]
T: Float,
impl<T> From<Alpha<Lab<T>, T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Yxy<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Hsl<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Xyz<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Alpha<Hsl<T>, T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Alpha<Lch<T>, T> where
T: Float,
[src]
T: Float,
impl<T> From<Alpha<Yxy<T>, T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Alpha<Yxy<T>, T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsl<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Xyz<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Alpha<Hwb<T>, T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Yxy<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Lab<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Rgb<T> where
T: Float,
[src]
T: Float,
impl<T> From<Alpha<Rgb<T>, T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Alpha<Hsv<T>, T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hwb<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Alpha<Xyz<T>, T> where
T: Float,
[src]
T: Float,
impl<T> From<Alpha<Xyz<T>, T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Alpha<Hwb<T>, T> where
T: Float,
[src]
T: Float,
impl<T> From<Alpha<Lch<T>, T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Rgb<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Alpha<Hsl<T>, T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Lab<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Hwb<T> where
T: Float,
[src]
T: Float,
impl<T> From<Luma<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Alpha<Luma<T>, T>> for Hsv<T> where
T: Float,
[src]
T: Float,
impl<T> From<Hsv<T>> for Alpha<Rgb<T>, T> where
T: Float,
[src]
T: Float,
impl<T> FromColor<T> for Hsv<T> where
T: Float,
[src]
T: Float,
fn from_xyz(xyz: Xyz<T>) -> Hsv<T>
[src]
Convert from XYZ color space
fn from_rgb(rgb: Rgb<T>) -> Hsv<T>
[src]
Convert from RGB color space
fn from_hsl(hsl: Hsl<T>) -> Hsv<T>
[src]
Convert from HSL color space
fn from_hsv(hsv: Hsv<T>) -> Hsv<T>
[src]
Convert from HSV color space
fn from_hwb(hwb: Hwb<T>) -> Hsv<T>
[src]
Convert from HWB color space
fn from_yxy(inp: Yxy<T>) -> Self
[src]
Convert from Yxy color space
fn from_lab(inp: Lab<T>) -> Self
[src]
Convert from Lab* color space
fn from_lch(inp: Lch<T>) -> Self
[src]
Convert from LCh° color space
fn from_luma(inp: Luma<T>) -> Self
[src]
Convert from Luma
impl<T> Clone for Hsv<T> where
T: Clone + Float,
[src]
T: Clone + Float,
fn clone(&self) -> Hsv<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> Add<Hsv<T>> for Hsv<T> where
T: Float,
[src]
T: Float,
type Output = Hsv<T>
The resulting type after applying the +
operator.
fn add(self, other: Hsv<T>) -> Hsv<T>
[src]
Performs the +
operation.
impl<T> Add<T> for Hsv<T> where
T: Float,
[src]
T: Float,
type Output = Hsv<T>
The resulting type after applying the +
operator.
fn add(self, c: T) -> Hsv<T>
[src]
Performs the +
operation.
impl<T> Limited for Hsv<T> where
T: Float,
[src]
T: Float,
fn is_valid(&self) -> bool
[src]
Check if the color's components are within the expected ranges.
fn clamp(&self) -> Hsv<T>
[src]
Return a new color where the components has been clamped to the nearest valid values. Read more
fn clamp_self(&mut self)
[src]
Clamp the color's components to the nearest valid values.
impl<T> IntoColor<T> for Hsv<T> where
T: Float,
[src]
T: Float,
fn into_xyz(self) -> Xyz<T>
[src]
Convert into XYZ space
fn into_yxy(self) -> Yxy<T>
[src]
Convert into Yxy color space
fn into_lab(self) -> Lab<T>
[src]
Convert into Lab* color space
fn into_lch(self) -> Lch<T>
[src]
Convert into LCh° color space
fn into_rgb(self) -> Rgb<T>
[src]
Convert into RGB color space.
fn into_hsl(self) -> Hsl<T>
[src]
Convert into HSL color space
fn into_hsv(self) -> Hsv<T>
[src]
Convert into HSV color space
fn into_luma(self) -> Luma<T>
[src]
Convert into Luma
fn into_hwb(self) -> Hwb<T>
[src]
Convert into HWB color space
impl<T> Debug for Hsv<T> where
T: Debug + Float,
[src]
T: Debug + Float,
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<S> IntoRgba<S> for Hsv<S> where
S: Float + One,
[src]
S: Float + One,