# Struct palette::LabHue
[−]
[src]

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

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: Float> LabHue<T>`

[src]

`fn from_radians(radians: T) -> LabHue<T>`

[src]

Create a new hue from radians, instead of degrees.

`fn to_degrees(self) -> T`

[src]

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

.

`fn to_radians(self) -> T`

[src]

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

.

`fn to_positive_degrees(self) -> T`

[src]

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

.

`fn to_positive_radians(self) -> T`

[src]

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

.

## Trait Implementations

`impl<T: Clone + Float> Clone for LabHue<T>`

[src]

`fn clone(&self) -> LabHue<T>`

[src]

Returns a copy of the value. Read more

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

1.0.0[src]

Performs copy-assignment from `source`

. Read more

`impl<T: Copy + Float> Copy for LabHue<T>`

[src]

`impl<T: Debug + Float> Debug for LabHue<T>`

[src]

`impl<T: Default + Float> Default for LabHue<T>`

[src]

`impl<T: Float> From<T> for LabHue<T>`

[src]

`impl Into<f64> for LabHue<f64>`

[src]

`impl Into<f32> for LabHue<f32>`

[src]

`impl Into<f32> for LabHue<f64>`

[src]

`impl<T: Float> PartialEq for LabHue<T>`

[src]

`fn eq(&self, other: &LabHue<T>) -> bool`

[src]

This method tests for `self`

and `other`

values to be equal, and is used by `==`

. Read more

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

1.0.0[src]

This method tests for `!=`

.

`impl<T: Float> PartialEq<T> for LabHue<T>`

[src]

`fn eq(&self, other: &T) -> bool`

[src]

This method tests for `self`

and `other`

values to be equal, and is used by `==`

. Read more

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

1.0.0[src]

This method tests for `!=`

.

`impl<T: Float> Add<LabHue<T>> for LabHue<T>`

[src]

`type Output = LabHue<T>`

The resulting type after applying the `+`

operator.

`fn add(self, other: LabHue<T>) -> LabHue<T>`

[src]

Performs the `+`

operation.

`impl<T: Float> Add<T> for LabHue<T>`

[src]

`type Output = LabHue<T>`

The resulting type after applying the `+`

operator.

`fn add(self, other: T) -> LabHue<T>`

[src]

Performs the `+`

operation.

`impl<T: Float> Sub<LabHue<T>> for LabHue<T>`

[src]

`type Output = LabHue<T>`

The resulting type after applying the `-`

operator.

`fn sub(self, other: LabHue<T>) -> LabHue<T>`

[src]

Performs the `-`

operation.

`impl<T: Float> Sub<T> for LabHue<T>`

[src]

`type Output = LabHue<T>`

The resulting type after applying the `-`

operator.

`fn sub(self, other: T) -> LabHue<T>`

[src]

Performs the `-`

operation.

`impl<T: Float + ApproxEq> ApproxEq for LabHue<T> where`

<T as ApproxEq>::Epsilon: Float,

[src]

<T as ApproxEq>::Epsilon: Float,

`type Epsilon = <T as ApproxEq>::Epsilon`

Used for specifying relative comparisons.

`fn default_epsilon() -> Self::Epsilon`

[src]

The default tolerance to use when testing values that are close together. Read more

`fn default_max_relative() -> Self::Epsilon`

[src]

The default relative tolerance for testing values that are far-apart. Read more

`fn default_max_ulps() -> u32`

[src]

The default ULPs to tolerate when testing values that are far-apart. Read more

`fn relative_eq(`

&self,

other: &Self,

epsilon: Self::Epsilon,

max_relative: Self::Epsilon

) -> bool

[src]

&self,

other: &Self,

epsilon: Self::Epsilon,

max_relative: Self::Epsilon

) -> bool

A test for equality that uses a relative comparison if the values are far apart.

`fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool`

[src]

A test for equality that uses units in the last place (ULP) if the values are far apart.

`fn relative_ne(`

&self,

other: &Self,

epsilon: Self::Epsilon,

max_relative: Self::Epsilon

) -> bool

[src]

&self,

other: &Self,

epsilon: Self::Epsilon,

max_relative: Self::Epsilon

) -> bool

The inverse of `ApproxEq::relative_eq`

.

`fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool`

[src]

The inverse of `ApproxEq::ulps_eq`

.