[][src]Struct palette::RgbHue

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

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

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

Create a new hue from degrees.

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π).

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: Copy + Float> Copy for RgbHue<T>[src]

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

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

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

Performs copy-assignment from source. Read more

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

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

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

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

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

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

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

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

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

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

type Output = RgbHue<T>

The resulting type after applying the + operator.

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

type Output = RgbHue<T>

The resulting type after applying the + operator.

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

type Output = RgbHue<f32>

The resulting type after applying the + operator.

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

type Output = RgbHue<f64>

The resulting type after applying the + operator.

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

type Output = RgbHue<T>

The resulting type after applying the - operator.

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

type Output = RgbHue<T>

The resulting type after applying the - operator.

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

type Output = RgbHue<f32>

The resulting type after applying the - operator.

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

type Output = RgbHue<f64>

The resulting type after applying the - operator.

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

type Epsilon = <T as ApproxEq>::Epsilon

Used for specifying relative comparisons.

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

impl<'de, T: Float> Deserialize<'de> for RgbHue<T> where
    T: Deserialize<'de>, 
[src]

Auto Trait Implementations

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

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

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

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

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

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]

fn adapt_into(self) -> D[src]

Convert the source color to the destination color using the bradford method by default Read more

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

type Owned = T

The resulting type after obtaining ownership.

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

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]