Struct palette::Xyz [] [src]

pub struct Xyz {
    pub x: f32,
    pub y: f32,
    pub z: f32,
    pub alpha: f32,
}

The CIE 1931 XYZ color space with an alpha component.

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: f32

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 1.0.

y: f32

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

z: f32

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

alpha: f32

The transparency of the color. 0.0 is completely transparent and 1.0 is completely opaque.

Methods

impl Xyz
[src]

fn xyz(x: f32, y: f32, z: f32) -> Xyz

CIE XYZ.

fn xyza(x: f32, y: f32, z: f32, alpha: f32) -> Xyz

CIE XYZ and transparency.

Trait Implementations

impl PartialEq for Xyz
[src]

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

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

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

This method tests for !=.

impl Debug for Xyz
[src]

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

Formats the value using the given formatter.

impl Copy for Xyz
[src]

impl Clone for Xyz
[src]

fn clone(&self) -> Xyz

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 ColorSpace for Xyz
[src]

fn is_valid(&self) -> bool

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

fn clamp(&self) -> Xyz

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 Mix for Xyz
[src]

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

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

impl Shade for Xyz
[src]

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

Lighten the color by amount.

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

Darken the color by amount.

impl Default for Xyz
[src]

fn default() -> Xyz

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

impl Add<Xyz> for Xyz
[src]

type Output = Xyz

The resulting type after applying the + operator

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

The method for the + operator

impl Add<f32> for Xyz
[src]

type Output = Xyz

The resulting type after applying the + operator

fn add(self, c: f32) -> Xyz

The method for the + operator

impl Sub<Xyz> for Xyz
[src]

type Output = Xyz

The resulting type after applying the - operator

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

The method for the - operator

impl Sub<f32> for Xyz
[src]

type Output = Xyz

The resulting type after applying the - operator

fn sub(self, c: f32) -> Xyz

The method for the - operator

impl Mul<Xyz> for Xyz
[src]

type Output = Xyz

The resulting type after applying the * operator

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

The method for the * operator

impl Mul<f32> for Xyz
[src]

type Output = Xyz

The resulting type after applying the * operator

fn mul(self, c: f32) -> Xyz

The method for the * operator

impl Div<Xyz> for Xyz
[src]

type Output = Xyz

The resulting type after applying the / operator

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

The method for the / operator

impl Div<f32> for Xyz
[src]

type Output = Xyz

The resulting type after applying the / operator

fn div(self, c: f32) -> Xyz

The method for the / operator

impl From<Color> for Xyz
[src]

fn from(color: Color) -> Xyz

Performs the conversion.

impl From<Rgb> for Xyz
[src]

fn from(rgb: Rgb) -> Xyz

Performs the conversion.

impl From<Luma> for Xyz
[src]

fn from(luma: Luma) -> Xyz

Performs the conversion.

impl From<Lab> for Xyz
[src]

fn from(lab: Lab) -> Xyz

Performs the conversion.

impl From<Lch> for Xyz
[src]

fn from(lch: Lch) -> Xyz

Performs the conversion.

impl From<Hsv> for Xyz
[src]

fn from(hsv: Hsv) -> Xyz

Performs the conversion.

impl From<Hsl> for Xyz
[src]

fn from(hsl: Hsl) -> Xyz

Performs the conversion.