Struct palette::Xyz [] [src]

pub struct Xyz<T: Float = f32> {
    pub x: T,
    pub y: T,
    pub z: T,
}

The CIE 1931 XYZ color space.

XYZ links the perceived colors to their wavelengths and simply makes it possible to describe the way we see colors as numbers. It's often used when converting from one color space to an other, and requires a standard illuminant and a standard observer to be defined.

Conversions and operations on this color space assumes the CIE Standard Illuminant D65 as the white point, and the 2° standard colorimetric observer.

Fields

x: T

X is the scale of what can be seen as a response curve for the cone cells in the human eye. It goes from 0.0 to 0.95047.

y: T

Y is the luminance of the color, where 0.0 is black and 1.0 is white.

z: T

Z is the scale of what can be seen as the blue stimulation. It goes from 0.0 to 1.08883.

Methods

impl<T: Float> Xyz<T>
[src]

fn new(x: T, y: T, z: T) -> Xyz<T>

CIE XYZ.

Trait Implementations

impl<T: PartialEq + Float> PartialEq for Xyz<T>
[src]

fn eq(&self, __arg_0: &Xyz<T>) -> bool

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

fn ne(&self, __arg_0: &Xyz<T>) -> bool

This method tests for !=.

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

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

Formats the value using the given formatter.

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

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

fn clone(&self) -> Xyz<T>

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<T: Float> Limited for Xyz<T>
[src]

fn is_valid(&self) -> bool

Check if the color's components are within the expected ranges.

fn clamp(&self) -> Xyz<T>

Return a new color where the components has been clamped to the nearest valid values. Read more

fn clamp_self(&mut self)

Clamp the color's components to the nearest valid values.

impl<T: Float> Mix for Xyz<T>
[src]

type Scalar = T

The type of the mixing factor.

fn mix(&self, other: &Xyz<T>, factor: T) -> Xyz<T>

Mix the color with an other color, by factor. Read more

impl<T: Float> Shade for Xyz<T>
[src]

type Scalar = T

The type of the lighten/darken amount.

fn lighten(&self, amount: T) -> Xyz<T>

Lighten the color by amount.

fn darken(&self, amount: Self::Scalar) -> Self

Darken the color by amount.

impl<T: Float> Default for Xyz<T>
[src]

fn default() -> Xyz<T>

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

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

type Output = Xyz<T>

The resulting type after applying the + operator

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

The method for the + operator

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

type Output = Xyz<T>

The resulting type after applying the + operator

fn add(self, c: T) -> Xyz<T>

The method for the + operator

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

type Output = Xyz<T>

The resulting type after applying the - operator

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

The method for the - operator

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

type Output = Xyz<T>

The resulting type after applying the - operator

fn sub(self, c: T) -> Xyz<T>

The method for the - operator

impl<T: Float> Mul<Xyz<T>> for Xyz<T>
[src]

type Output = Xyz<T>

The resulting type after applying the * operator

fn mul(self, other: Xyz<T>) -> Xyz<T>

The method for the * operator

impl<T: Float> Mul<T> for Xyz<T>
[src]

type Output = Xyz<T>

The resulting type after applying the * operator

fn mul(self, c: T) -> Xyz<T>

The method for the * operator

impl<T: Float> Div<Xyz<T>> for Xyz<T>
[src]

type Output = Xyz<T>

The resulting type after applying the / operator

fn div(self, other: Xyz<T>) -> Xyz<T>

The method for the / operator

impl<T: Float> Div<T> for Xyz<T>
[src]

type Output = Xyz<T>

The resulting type after applying the / operator

fn div(self, c: T) -> Xyz<T>

The method for the / operator

impl<T: Float> From<Color<T>> for Xyz<T>
[src]

fn from(color: Color<T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Alpha<Xyz<T>, T>> for Xyz<T>
[src]

fn from(color: Alpha<Xyz<T>, T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Alpha<Rgb<T>, T>> for Xyz<T>
[src]

fn from(other: Alpha<Rgb<T>, T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Alpha<Luma<T>, T>> for Xyz<T>
[src]

fn from(other: Alpha<Luma<T>, T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Alpha<Lab<T>, T>> for Xyz<T>
[src]

fn from(other: Alpha<Lab<T>, T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Alpha<Lch<T>, T>> for Xyz<T>
[src]

fn from(other: Alpha<Lch<T>, T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Alpha<Hsv<T>, T>> for Xyz<T>
[src]

fn from(other: Alpha<Hsv<T>, T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Alpha<Hsl<T>, T>> for Xyz<T>
[src]

fn from(other: Alpha<Hsl<T>, T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Alpha<Color<T>, T>> for Xyz<T>
[src]

fn from(other: Alpha<Color<T>, T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Rgb<T>> for Xyz<T>
[src]

fn from(rgb: Rgb<T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Luma<T>> for Xyz<T>
[src]

fn from(luma: Luma<T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Lab<T>> for Xyz<T>
[src]

fn from(lab: Lab<T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Lch<T>> for Xyz<T>
[src]

fn from(lch: Lch<T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Hsv<T>> for Xyz<T>
[src]

fn from(hsv: Hsv<T>) -> Xyz<T>

Performs the conversion.

impl<T: Float> From<Hsl<T>> for Xyz<T>
[src]

fn from(hsl: Hsl<T>) -> Xyz<T>

Performs the conversion.