[][src]Struct nannou::color::RgbHue

pub struct RgbHue<T = f32>(_)
where
    T: Float
;

A hue type for the RGB family of color spaces.

It's measured in degrees and uses the three additive primaries red, green and blue.

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> RgbHue<T> where
    T: Float
[src]

pub fn from_radians(radians: T) -> RgbHue<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π).

Trait Implementations

impl<T> ApproxEq for RgbHue<T> where
    T: ApproxEq + Float,
    <T as ApproxEq>::Epsilon: Float
[src]

type Epsilon = <T as ApproxEq>::Epsilon

Used for specifying relative comparisons.

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

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

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

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

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

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

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

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

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

type Output = RgbHue<T>

The resulting type after applying the + operator.

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

type Output = RgbHue<T>

The resulting type after applying the + operator.

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

type Output = RgbHue<T>

The resulting type after applying the - operator.

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

type Output = RgbHue<T>

The resulting type after applying the - operator.

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

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

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

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

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

impl<T> Content for T[src]

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

impl<T> Erased for T

impl<S> FromSample<S> for S[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.