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