Struct immense::RgbHue

source ·
pub struct RgbHue<T = f32>(_)
where
    T: Float
;
Expand description

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.

Implementations

Create a new hue from degrees.

Create a new hue from radians, instead of degrees.

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

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

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

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

Get the internal representation, without normalizing it.

Get the internal representation as radians, without normalizing it.

Trait Implementations

The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
Used for specifying relative comparisons.
The default tolerance to use when testing values that are close together. Read more
The default relative tolerance for testing values that are far-apart. Read more
The default ULPs to tolerate when testing values that are far-apart. Read more
A test for equality that uses a relative comparison if the values are far apart.
A test for equality that uses units in the last place (ULP) if the values are far apart.
The inverse of ApproxEq::relative_eq.
The inverse of ApproxEq::ulps_eq.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

Convert the source color to the destination color using the specified method Read more
Convert the source color to the destination color using the bradford method by default Read more
Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts to this type from the input type.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
Tests if Self the same as the type T Read more
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.