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
Trait Implementations
sourceimpl<S, T> ApproxEq for Hsv<S, T>where
T: Component + Float + ApproxEq,
<T as ApproxEq>::Epsilon: Copy + Float,
S: RgbSpace,
impl<S, T> ApproxEq for Hsv<S, T>where
T: Component + Float + ApproxEq,
<T as ApproxEq>::Epsilon: Copy + Float,
S: RgbSpace,
type Epsilon = <T as ApproxEq>::Epsilon
type Epsilon = <T as ApproxEq>::Epsilon
sourcefn default_epsilon() -> <Hsv<S, T> as ApproxEq>::Epsilon
fn default_epsilon() -> <Hsv<S, T> as ApproxEq>::Epsilon
sourcefn default_max_relative() -> <Hsv<S, T> as ApproxEq>::Epsilon
fn default_max_relative() -> <Hsv<S, T> as ApproxEq>::Epsilon
sourcefn default_max_ulps() -> u32
fn default_max_ulps() -> u32
sourcefn relative_eq(
&self,
other: &Hsv<S, T>,
epsilon: <Hsv<S, T> as ApproxEq>::Epsilon,
max_relative: <Hsv<S, T> as ApproxEq>::Epsilon
) -> bool
fn relative_eq(
&self,
other: &Hsv<S, T>,
epsilon: <Hsv<S, T> as ApproxEq>::Epsilon,
max_relative: <Hsv<S, T> as ApproxEq>::Epsilon
) -> bool
sourcefn ulps_eq(
&self,
other: &Hsv<S, T>,
epsilon: <Hsv<S, T> as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
fn ulps_eq(
&self,
other: &Hsv<S, T>,
epsilon: <Hsv<S, T> as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
ApproxEq::relative_eq
.sourceimpl<S, T, P> AsMut<P> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
P: RawPixel<T> + ?Sized,
impl<S, T, P> AsMut<P> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
P: RawPixel<T> + ?Sized,
sourceimpl<S, T, P> AsRef<P> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
P: RawPixel<T> + ?Sized,
impl<S, T, P> AsRef<P> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
P: RawPixel<T> + ?Sized,
sourceimpl<S, T, H> From<(H, T, T)> for Hsv<S, T>where
S: RgbSpace,
T: Component + Float,
H: Into<RgbHue<T>>,
impl<S, T, H> From<(H, T, T)> for Hsv<S, T>where
S: RgbSpace,
T: Component + Float,
H: Into<RgbHue<T>>,
sourceimpl<S, T> From<Alpha<Lab<<S as RgbSpace>::WhitePoint, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> From<Alpha<Lab<<S as RgbSpace>::WhitePoint, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourceimpl<S, T> From<Alpha<Lch<<S as RgbSpace>::WhitePoint, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> From<Alpha<Lch<<S as RgbSpace>::WhitePoint, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourceimpl<S, T, _S> From<Alpha<Luma<_S, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
_S: LumaStandard<WhitePoint = <S as RgbSpace>::WhitePoint>,
impl<S, T, _S> From<Alpha<Luma<_S, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
_S: LumaStandard<WhitePoint = <S as RgbSpace>::WhitePoint>,
sourceimpl<S, T, _S> From<Alpha<Rgb<_S, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
_S: RgbStandard<Space = S>,
impl<S, T, _S> From<Alpha<Rgb<_S, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
_S: RgbStandard<Space = S>,
sourceimpl<S, T> From<Alpha<Xyz<<S as RgbSpace>::WhitePoint, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> From<Alpha<Xyz<<S as RgbSpace>::WhitePoint, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourceimpl<S, T> From<Alpha<Yxy<<S as RgbSpace>::WhitePoint, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> From<Alpha<Yxy<<S as RgbSpace>::WhitePoint, T>, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourceimpl<S, Sp, T> From<Hsl<Sp, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
Sp: RgbSpace<WhitePoint = <S as RgbSpace>::WhitePoint>,
impl<S, Sp, T> From<Hsl<Sp, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
Sp: RgbSpace<WhitePoint = <S as RgbSpace>::WhitePoint>,
sourceimpl<S, Sp, T> From<Hwb<Sp, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
Sp: RgbSpace<WhitePoint = <S as RgbSpace>::WhitePoint>,
impl<S, Sp, T> From<Hwb<Sp, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
Sp: RgbSpace<WhitePoint = <S as RgbSpace>::WhitePoint>,
sourceimpl<S, T> From<Lab<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> From<Lab<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourceimpl<S, T> From<Lch<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> From<Lch<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourceimpl<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>,
sourceimpl<S, T, _S> From<Rgb<_S, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
_S: RgbStandard<Space = S>,
impl<S, T, _S> From<Rgb<_S, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
_S: RgbStandard<Space = S>,
sourceimpl<S, T> From<Xyz<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> From<Xyz<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourceimpl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> From<Yxy<<S as RgbSpace>::WhitePoint, T>> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourceimpl<S, T> FromColor<<S as RgbSpace>::WhitePoint, T> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> FromColor<<S as RgbSpace>::WhitePoint, T> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourcefn from_xyz(color: Xyz<<S as RgbSpace>::WhitePoint, T>) -> Hsv<S, T>
fn from_xyz(color: Xyz<<S as RgbSpace>::WhitePoint, T>) -> Hsv<S, T>
sourcefn from_rgb<_S>(color: Rgb<Linear<_S>, T>) -> Hsv<S, T>where
_S: RgbSpace<WhitePoint = <S as RgbSpace>::WhitePoint>,
fn from_rgb<_S>(color: Rgb<Linear<_S>, T>) -> Hsv<S, T>where
_S: RgbSpace<WhitePoint = <S as RgbSpace>::WhitePoint>,
sourcefn from_hsl<_S>(color: Hsl<_S, T>) -> Hsv<S, T>where
_S: RgbSpace<WhitePoint = <S as RgbSpace>::WhitePoint>,
fn from_hsl<_S>(color: Hsl<_S, T>) -> Hsv<S, T>where
_S: RgbSpace<WhitePoint = <S as RgbSpace>::WhitePoint>,
sourcefn from_hwb<_S>(color: Hwb<_S, T>) -> Hsv<S, T>where
_S: RgbSpace<WhitePoint = <S as RgbSpace>::WhitePoint>,
fn from_hwb<_S>(color: Hwb<_S, T>) -> Hsv<S, T>where
_S: RgbSpace<WhitePoint = <S as RgbSpace>::WhitePoint>,
sourceimpl<S, Wp, T> IntoColor<Wp, T> for Hsv<S, T>where
T: Component + Float,
Wp: WhitePoint,
S: RgbSpace<WhitePoint = Wp>,
impl<S, Wp, T> IntoColor<Wp, T> for Hsv<S, T>where
T: Component + Float,
Wp: WhitePoint,
S: RgbSpace<WhitePoint = Wp>,
sourcefn into_rgb<Sp>(self) -> Rgb<Linear<Sp>, T>where
Sp: RgbSpace<WhitePoint = Wp>,
fn into_rgb<Sp>(self) -> Rgb<Linear<Sp>, T>where
Sp: RgbSpace<WhitePoint = Wp>,
sourcefn into_hsl<Sp>(self) -> Hsl<Sp, T>where
Sp: RgbSpace<WhitePoint = Wp>,
fn into_hsl<Sp>(self) -> Hsl<Sp, T>where
Sp: RgbSpace<WhitePoint = Wp>,
sourceimpl<S, T> Limited for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> Limited for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourceimpl<S, T> PartialEq<Hsv<S, T>> for Hsv<S, T>where
S: PartialEq<S> + RgbSpace,
T: PartialEq<T> + Component + Float,
impl<S, T> PartialEq<Hsv<S, T>> for Hsv<S, T>where
S: PartialEq<S> + RgbSpace,
T: PartialEq<T> + Component + Float,
sourceimpl<S, T> Pixel<T> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> Pixel<T> for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
sourcefn as_raw<P>(&self) -> &Pwhere
P: RawPixel<T> + ?Sized,
fn as_raw<P>(&self) -> &Pwhere
P: RawPixel<T> + ?Sized,
sourcefn as_raw_mut<P>(&mut self) -> &mut Pwhere
P: RawPixel<T> + ?Sized,
fn as_raw_mut<P>(&mut self) -> &mut Pwhere
P: RawPixel<T> + ?Sized,
sourcefn into_raw<P>(self) -> Pwhere
P: RawPixelSized<T>,
fn into_raw<P>(self) -> Pwhere
P: RawPixelSized<T>,
sourcefn from_raw<P>(pixel: &P) -> &Selfwhere
P: RawPixel<T> + ?Sized,
fn from_raw<P>(pixel: &P) -> &Selfwhere
P: RawPixel<T> + ?Sized,
sourcefn from_raw_mut<P>(pixel: &mut P) -> &mut Selfwhere
P: RawPixel<T> + ?Sized,
fn from_raw_mut<P>(pixel: &mut P) -> &mut Selfwhere
P: RawPixel<T> + ?Sized,
sourcefn from_raw_slice(slice: &[T]) -> &[Self]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn from_raw_slice(slice: &[T]) -> &[Self]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
sourcefn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn from_raw_slice_mut(slice: &mut [T]) -> &mut [Self]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
impl<S, T> Copy for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
impl<S, T> StructuralPartialEq for Hsv<S, T>where
T: Component + Float,
S: RgbSpace,
Auto Trait Implementations
impl<S, T> RefUnwindSafe for Hsv<S, T>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> Send for Hsv<S, T>where
S: Send,
T: Send,
impl<S, T> Sync for Hsv<S, T>where
S: Sync,
T: Sync,
impl<S, T> Unpin for Hsv<S, T>where
S: Unpin,
T: Unpin,
impl<S, T> UnwindSafe for Hsv<S, T>where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for Dwhere
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
S: IntoColor<Swp, T>,
D: FromColor<Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptFrom<S, Swp, Dwp, T> for Dwhere
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
S: IntoColor<Swp, T>,
D: FromColor<Dwp, T>,
sourcefn adapt_from_using<M>(color: S, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_from_using<M>(color: S, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
sourcefn adapt_from(color: S) -> Self
fn adapt_from(color: S) -> Self
sourceimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Component + Float,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
sourcefn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
sourcefn adapt_into(self) -> D
fn adapt_into(self) -> D
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.