#[repr(C)]pub struct Hsv<ComponentTy = f32> {
pub h: ComponentTy,
pub s: ComponentTy,
pub v: ComponentTy,
}
Expand description
A color in the HSV color space.
Since HSV is a relative color space, it is required to know the RGB space which it was transformed from. We define this as the linear sRGB space, as that is the most common case.
Fields
h: ComponentTy
The H (hue) component. Varies from 0 to 1.
s: ComponentTy
The S (saturation) component. Varies from 0 to 1.
v: ComponentTy
The V (value) component. Varies from 0 to 1.
Trait Implementations
sourceimpl<CTy: Clone + Copy> ColorType for Hsv<CTy>
impl<CTy: Clone + Copy> ColorType for Hsv<CTy>
type ComponentTy = CTy
const SPACE: Spaces = Spaces::Hsv
const NUM_COMPONENTS: usize = 3usize
sourceimpl<ComponentTy: Copy> From<PremultipliedAlpha<Hsv<ComponentTy>>> for Hsv<ComponentTy>
impl<ComponentTy: Copy> From<PremultipliedAlpha<Hsv<ComponentTy>>> for Hsv<ComponentTy>
sourcefn from(col_alpha: PremultipliedAlpha<Hsv<ComponentTy>>) -> Hsv<ComponentTy>
fn from(col_alpha: PremultipliedAlpha<Hsv<ComponentTy>>) -> Hsv<ComponentTy>
Converts to this type from the input type.
sourceimpl<ComponentTy: Ord> Ord for Hsv<ComponentTy>
impl<ComponentTy: Ord> Ord for Hsv<ComponentTy>
sourceimpl<ComponentTy: PartialOrd> PartialOrd<Hsv<ComponentTy>> for Hsv<ComponentTy>
impl<ComponentTy: PartialOrd> PartialOrd<Hsv<ComponentTy>> for Hsv<ComponentTy>
sourcefn partial_cmp(&self, other: &Hsv<ComponentTy>) -> Option<Ordering>
fn partial_cmp(&self, other: &Hsv<ComponentTy>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<ComponentTy: Copy> Copy for Hsv<ComponentTy>
impl<ComponentTy: Eq> Eq for Hsv<ComponentTy>
impl<ComponentTy: Pod> Pod for Hsv<ComponentTy>
impl<ComponentTy> StructuralEq for Hsv<ComponentTy>
impl<ComponentTy> StructuralPartialEq for Hsv<ComponentTy>
Auto Trait Implementations
impl<ComponentTy> RefUnwindSafe for Hsv<ComponentTy> where
ComponentTy: RefUnwindSafe,
impl<ComponentTy> Send for Hsv<ComponentTy> where
ComponentTy: Send,
impl<ComponentTy> Sync for Hsv<ComponentTy> where
ComponentTy: Sync,
impl<ComponentTy> Unpin for Hsv<ComponentTy> where
ComponentTy: Unpin,
impl<ComponentTy> UnwindSafe for Hsv<ComponentTy> where
ComponentTy: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedBitPattern for T where
T: AnyBitPattern,
impl<T> CheckedBitPattern for T where
T: AnyBitPattern,
type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during is_valid_bit_pattern
. Read more
sourcefn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret bits
as &Self
.