Struct palette::RgbHue [] [src]

#[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]

[src]

Create a new hue from degrees.

[src]

Create a new hue from radians, instead of degrees.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Get the internal representation, without normalizing it.

[src]

Get the internal representation as radians, without normalizing it.

Trait Implementations

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

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

[src]

Formats the value using the given formatter. Read more

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

[src]

Returns the "default value" for a type. Read more

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

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

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

Used for specifying relative comparisons.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

The inverse of ApproxEq::relative_eq.

[src]

The inverse of ApproxEq::ulps_eq.