Struct color::Hsl

source ·
pub struct Hsl<T = f32, S = Srgb> {
    pub h: Deg<T>,
    pub s: T,
    pub l: T,
    pub standard: PhantomData<S>,
}

Fields§

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

Implementations§

source§

impl<T, S> Hsl<T, S>

source

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

Trait Implementations§

source§

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

source§

fn clone(&self) -> Hsl<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 Hsl<T, S>

source§

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

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

source§

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

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

source§

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

Inverts the color.

source§

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

source§

impl<T: Debug, S: Debug> Debug for Hsl<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 Hsl<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 Hsl<T>

source§

fn saturate(self) -> Hsl<T>

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

source§

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

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, S> Serialize for Hsl<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> ToHsl for Hsl<T, S>

§

type Standard = S

source§

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

source§

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

§

type Standard = S

source§

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

source§

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

§

type Standard = S

source§

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

source§

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

source§

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

Auto Trait Implementations§

§

impl<T, S> RefUnwindSafe for Hsl<T, S>where S: RefUnwindSafe, T: RefUnwindSafe,

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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 Twhere T: for<'de> Deserialize<'de>,