color

Struct Hsv

Source
pub struct Hsv<T = f32, S = Srgb> {
    pub h: Deg<T>,
    pub s: T,
    pub v: T,
    pub standard: PhantomData<S>,
}

Fields§

§h: Deg<T>§s: T§v: T§standard: PhantomData<S>

Implementations§

Source§

impl<T, S> Hsv<T, S>

Source

pub const fn new(h: Deg<T>, s: T, v: T) -> Hsv<T, S>

Trait Implementations§

Source§

impl<T: Clone, S> Clone for Hsv<T, S>

Source§

fn clone(&self) -> Hsv<T, S>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Channel + NumCast + Num, S: TransferFunction> Color<T> for Hsv<T, S>

Source§

fn clamp_s(self, lo: T, hi: T) -> Hsv<T, S>

Clamps the components of the color to the range (lo,hi).

Source§

fn clamp_c(self, lo: Hsv<T, S>, hi: Hsv<T, S>) -> Hsv<T, S>

Clamps the components of the color component-wise between lo and hi.

Source§

fn inverse(self) -> Hsv<T, S>

Inverts the color.

Source§

fn mix(self, other: Self, value: T) -> Self

Source§

impl<T: Debug, S: Debug> Debug for Hsv<T, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, T, S> Deserialize<'de> for Hsv<T, S>
where T: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T: FloatChannel> FloatColor<T> for Hsv<T>

Source§

fn saturate(self) -> Hsv<T>

Normalizes the components of the color. Modulo 360 is applied to the h component, and s and v are clamped to the range (0,1).

Source§

impl<N: Clone + PartialEq + Num + NumCast, S> PartialEq for Hsv<N, S>

Source§

fn eq(&self, other: &Hsv<N, S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, S> Serialize for Hsv<T, S>
where T: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T: Channel + NumCast + Num, S: TransferFunction> ToHsv for Hsv<T, S>

Source§

type Standard = S

Source§

fn to_hsv<U: Channel + NumCast + Num>(&self) -> Hsv<U, S>

Source§

impl<T: Clone + Channel + NumCast + Num, S: TransferFunction> ToRgb for Hsv<T, S>

Source§

type Standard = S

Source§

fn to_rgb<U: Channel>(&self) -> Rgb<U, S>

Source§

impl<T: Clone + FloatChannel, S: TransferFunction> ToRgba for Hsv<T, S>

Source§

type Standard = S

Source§

fn to_rgba<U: Channel>(&self) -> Rgba<U, S>

Source§

impl<T: Copy, S> Copy for Hsv<T, S>

Source§

impl<N: Clone + PartialEq + Eq + Num + NumCast, S> Eq for Hsv<N, S>

Auto Trait Implementations§

§

impl<T, S> Freeze for Hsv<T, S>
where T: Freeze,

§

impl<T, S> RefUnwindSafe for Hsv<T, S>

§

impl<T, S> Send for Hsv<T, S>
where T: Send, S: Send,

§

impl<T, S> Sync for Hsv<T, S>
where T: Sync, S: Sync,

§

impl<T, S> Unpin for Hsv<T, S>
where T: Unpin, S: Unpin,

§

impl<T, S> UnwindSafe for Hsv<T, S>
where T: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,