Struct palette::LabHue [] [src]

pub struct LabHue(_);

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

fn from_radians(radians: f32) -> LabHue

Create a new hue from radians, instead of degrees.

fn to_radians(self) -> f32

Convert the hue to radians.

Trait Implementations

impl Default for LabHue
[src]

fn default() -> LabHue

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

impl Debug for LabHue
[src]

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

Formats the value using the given formatter.

impl Copy for LabHue
[src]

impl Clone for LabHue
[src]

fn clone(&self) -> LabHue

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

fn from(degrees: f32) -> LabHue

Performs the conversion.

impl Into<f32> for LabHue
[src]

fn into(self) -> f32

Performs the conversion.

impl PartialEq for LabHue
[src]

fn eq(&self, other: &LabHue) -> 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 LabHue
[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<LabHue> for LabHue
[src]

type Output = LabHue

The resulting type after applying the + operator

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

The method for the + operator

impl Add<f32> for LabHue
[src]

type Output = LabHue

The resulting type after applying the + operator

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

The method for the + operator

impl Sub<LabHue> for LabHue
[src]

type Output = LabHue

The resulting type after applying the - operator

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

The method for the - operator

impl Sub<f32> for LabHue
[src]

type Output = LabHue

The resulting type after applying the - operator

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

The method for the - operator