[][src]Struct nannou::color::LabHue

#[repr(C)]
pub struct LabHue<T = f32>(_)
where
    T: Float
;

A hue type for the CIE L*a*b* family of color spaces.

It's measured in degrees and it's based on the four physiological elementary colors red, yellow, green and blue. This makes it different from the hue of RGB based color spaces.

The hue is a circular type, where 0 and 360 is the same, and it's normalized to (-180, 180] when it's converted to a linear number (like f32). This makes many calculations easier, but may also have some surprising effects if it's expected to act as a linear number.

Methods

impl<T> LabHue<T> where
    T: Float
[src]

pub fn from_degrees(degrees: T) -> LabHue<T>[src]

Create a new hue from degrees.

pub fn from_radians(radians: T) -> LabHue<T>[src]

Create a new hue from radians, instead of degrees.

pub fn to_degrees(self) -> T[src]

Get the hue as degrees, in the range (-180, 180].

pub fn to_radians(self) -> T[src]

Convert the hue to radians, in the range (-π, π].

pub fn to_positive_degrees(self) -> T[src]

Convert the hue to positive degrees, in the range [0, 360).

pub fn to_positive_radians(self) -> T[src]

Convert the hue to positive radians, in the range [0, 2π).

pub fn to_raw_degrees(self) -> T[src]

Get the internal representation, without normalizing it.

pub fn to_raw_radians(self) -> T[src]

Get the internal representation as radians, without normalizing it.

Trait Implementations

impl<T> AbsDiffEq<LabHue<T>> for LabHue<T> where
    T: AbsDiffEq<T> + Float,
    <T as AbsDiffEq<T>>::Epsilon: Float
[src]

type Epsilon = <T as AbsDiffEq<T>>::Epsilon

Used for specifying relative comparisons.

impl<T> Add<LabHue<T>> for LabHue<T> where
    T: Float
[src]

type Output = LabHue<T>

The resulting type after applying the + operator.

impl<T> Add<T> for LabHue<T> where
    T: Float
[src]

type Output = LabHue<T>

The resulting type after applying the + operator.

impl<T> AddAssign<LabHue<T>> for LabHue<T> where
    T: AddAssign<T> + Float
[src]

impl<T> AddAssign<T> for LabHue<T> where
    T: AddAssign<T> + Float
[src]

impl<T> Clone for LabHue<T> where
    T: Clone + Float
[src]

impl<T> Copy for LabHue<T> where
    T: Copy + Float
[src]

impl<T> Debug for LabHue<T> where
    T: Debug + Float
[src]

impl<T> Default for LabHue<T> where
    T: Default + Float
[src]

impl<T> From<T> for LabHue<T> where
    T: Float
[src]

impl Into<f32> for LabHue<f32>[src]

impl Into<f32> for LabHue<f64>[src]

impl Into<f64> for LabHue<f64>[src]

impl<T> PartialEq<LabHue<T>> for LabHue<T> where
    T: Float
[src]

impl<T> PartialEq<T> for LabHue<T> where
    T: Float
[src]

impl<T> RelativeEq<LabHue<T>> for LabHue<T> where
    T: RelativeEq<T> + Float,
    <T as AbsDiffEq<T>>::Epsilon: Float
[src]

impl<T> Sub<LabHue<T>> for LabHue<T> where
    T: Float
[src]

type Output = LabHue<T>

The resulting type after applying the - operator.

impl<T> Sub<T> for LabHue<T> where
    T: Float
[src]

type Output = LabHue<T>

The resulting type after applying the - operator.

impl<T> SubAssign<LabHue<T>> for LabHue<T> where
    T: SubAssign<T> + Float
[src]

impl<T> SubAssign<T> for LabHue<T> where
    T: SubAssign<T> + Float
[src]

impl<T> UlpsEq<LabHue<T>> for LabHue<T> where
    T: UlpsEq<T> + Float,
    <T as AbsDiffEq<T>>::Epsilon: Float
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for LabHue<T> where
    T: RefUnwindSafe

impl<T> Send for LabHue<T> where
    T: Send

impl<T> Sync for LabHue<T> where
    T: Sync

impl<T> Unpin for LabHue<T> where
    T: Unpin

impl<T> UnwindSafe for LabHue<T> where
    T: UnwindSafe

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> SetParameter for T

impl<T> Style for T where
    T: Any + Debug + PartialEq<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,