Struct palette::RgbHue [] [src]

pub struct RgbHue(_);

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

fn from_radians(radians: f32) -> RgbHue

Create a new hue from radians, instead of degrees.

fn to_radians(self) -> f32

Convert the hue to radians.

Trait Implementations

impl Default for RgbHue
[src]

fn default() -> RgbHue

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

impl Debug for RgbHue
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Copy for RgbHue
[src]

impl Clone for RgbHue
[src]

fn clone(&self) -> RgbHue

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl From<f32> for RgbHue
[src]

fn from(degrees: f32) -> RgbHue

Performs the conversion.

impl Into<f32> for RgbHue
[src]

fn into(self) -> f32

Performs the conversion.

impl PartialEq for RgbHue
[src]

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

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

This method tests for !=.

impl PartialEq<f32> for RgbHue
[src]

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

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

This method tests for !=.

impl Add<RgbHue> for RgbHue
[src]

type Output = RgbHue

The resulting type after applying the + operator

fn add(self, other: RgbHue) -> RgbHue

The method for the + operator

impl Add<f32> for RgbHue
[src]

type Output = RgbHue

The resulting type after applying the + operator

fn add(self, other: f32) -> RgbHue

The method for the + operator

impl Sub<RgbHue> for RgbHue
[src]

type Output = RgbHue

The resulting type after applying the - operator

fn sub(self, other: RgbHue) -> RgbHue

The method for the - operator

impl Sub<f32> for RgbHue
[src]

type Output = RgbHue

The resulting type after applying the - operator

fn sub(self, other: f32) -> RgbHue

The method for the - operator