Struct nannou::color::Hsv [−][src]
#[repr(C)]pub struct Hsv<S = Srgb, T = f32> where
T: Component + Float,
S: RgbSpace, { pub hue: RgbHue<T>, pub saturation: T, pub value: T, pub space: PhantomData<S>, }
Expand description
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.
space: PhantomData<S>
The white point and RGB primaries this color is adapted to. The default is the sRGB standard.
Implementations
Linear HSV.
Convert to a (hue, saturation, value)
tuple.
Trait Implementations
type Epsilon = <T as AbsDiffEq<T>>::Epsilon
type Epsilon = <T as AbsDiffEq<T>>::Epsilon
Used for specifying relative comparisons.
The default tolerance to use when testing values that are close together. Read more
A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of ApproxEq::abs_diff_eq
.
Performs the +=
operation. Read more
Performs the +=
operation. Read more
impl<'de, S, T> Deserialize<'de> for Hsv<S, T> where
T: Component + Float + Deserialize<'de>,
S: RgbSpace,
impl<'de, S, T> Deserialize<'de> for Hsv<S, T> where
T: Component + Float + Deserialize<'de>,
S: RgbSpace,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Hsv<S, T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Hsv<S, T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<S, T> From<Hsv<<S as RgbStandard>::Space, T>> for Alpha<Rgb<S, T>, T> where
T: Component + Float,
S: RgbStandard,
impl<S, T> From<Hsv<<S as RgbStandard>::Space, T>> for Alpha<Rgb<S, T>, T> where
T: Component + Float,
S: RgbStandard,
impl<S, T, Sp, Wp> From<Hsv<Sp, T>> for Rgb<S, T> where
T: Component + Float,
S: RgbStandard,
Wp: WhitePoint,
Sp: RgbSpace<WhitePoint = Wp>,
<S as RgbStandard>::Space: RgbSpace,
<<S as RgbStandard>::Space as RgbSpace>::WhitePoint == Wp,
impl<S, T, Sp, Wp> From<Hsv<Sp, T>> for Rgb<S, T> where
T: Component + Float,
S: RgbStandard,
Wp: WhitePoint,
Sp: RgbSpace<WhitePoint = Wp>,
<S as RgbStandard>::Space: RgbSpace,
<<S as RgbStandard>::Space as RgbSpace>::WhitePoint == Wp,
impl<S, T, _S> From<Hsv<_S, T>> for Alpha<Luma<S, T>, T> where
T: Component + Float,
S: LumaStandard,
_S: RgbSpace<WhitePoint = <S as LumaStandard>::WhitePoint>,
impl<S, T, _S> From<Hsv<_S, T>> for Alpha<Luma<S, T>, T> where
T: Component + Float,
S: LumaStandard,
_S: RgbSpace<WhitePoint = <S as LumaStandard>::WhitePoint>,
impl<S, T, _S> From<Hsv<_S, T>> for Luma<S, T> where
T: Component + Float,
S: LumaStandard,
_S: RgbSpace<WhitePoint = <S as LumaStandard>::WhitePoint>,
impl<S, T, _S> From<Hsv<_S, T>> for Luma<S, T> where
T: Component + Float,
S: LumaStandard,
_S: RgbSpace<WhitePoint = <S as LumaStandard>::WhitePoint>,
impl<S, T, _S> From<Luma<_S, T>> for Hsv<S, T> where
T: Component + Float,
S: RgbSpace,
_S: LumaStandard<WhitePoint = <S as RgbSpace>::WhitePoint>,
impl<S, T, _S> From<Luma<_S, T>> for Hsv<S, T> where
T: Component + Float,
S: RgbSpace,
_S: LumaStandard<WhitePoint = <S as RgbSpace>::WhitePoint>,
Convert from XYZ color space
Convert from RGB color space
Convert from HSL color space
Convert from HWB color space
Convert from HSV color space
Return a new copy of self
, but with a specific hue.
Convert into RGB color space.
Convert into HSL color space
Convert into HSV color space
Return a new color where the components has been clamped to the nearest valid values. Read more
Clamp the color’s components to the nearest valid values.
Cast as a reference to raw color components.
Cast as a mutable reference to raw color components.
Convert from raw color components.
Cast from a reference to raw color components.
Cast from a mutable reference to raw color components.
Cast a slice of raw color components to a slice of colors. Read more
Cast a mutable slice of raw color components to a mutable slice of colors. Read more
Cast a slice of colors to a slice of raw color components. Read more
The default relative tolerance for testing values that are far-apart. Read more
A test for equality that uses a relative comparison if the values are far apart.
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Performs the -=
operation. Read more
Performs the -=
operation. Read more
The default ULPs to tolerate when testing values that are far-apart. Read more
A test for equality that uses units in the last place (ULP) if the values are far apart.
Auto Trait Implementations
impl<S, T> RefUnwindSafe for Hsv<S, T> where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> UnwindSafe for Hsv<S, T> where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for D where
T: Component + Float,
S: IntoColor<Swp, T>,
D: FromColor<Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for D where
T: Component + Float,
S: IntoColor<Swp, T>,
D: FromColor<Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
Mutably borrows from an owned value. Read more
Convert from T with values clamped to the color defined bounds Read more
Convert from T, returning ok if the color is inside of its defined range,
otherwise an OutOfBounds
error is returned which contains the unclamped color. Read more
Convert from T. The resulting color might be invalid in its color space Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined range,
otherwise an OutOfBounds
error is returned which contains the unclamped color. Read more
pub fn vzip(self) -> V