XYZ

A CIE 1931 XYZ color, parameterised for component type.

Constructors

this
this(ComponentType X, ComponentType Y, ComponentType Z)

Construct a color from XYZ values.

Members

Aliases

ComponentType
alias ComponentType = F

Type of the color components.

Functions

opCast
Color opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin ColorOperators!(TypeTuple!("X", "Y", "Z"))
Undocumented in source.

Properties

tristimulus
auto tristimulus [@property getter]

Return the XYZ tristimulus values as a tuple.

Variables

X
F X;

X value.

Y
F Y;

Y value.

Z
F Z;

Z value.

Examples

// CIE XYZ 1931 color with float components
alias XYZf = XYZ!float;

XYZf c = XYZf(0.8, 1, 1.2);

// tristimulus() returns a tuple of the components
assert(c.tristimulus == tuple(c.X, c.Y, c.Z));

// test XYZ operators and functions
static assert(XYZf(0, 0.5, 0) + XYZf(0.5, 0.5, 1) == XYZf(0.5, 1, 1));
static assert(XYZf(0.5, 0.5, 1) * 100.0 == XYZf(50, 50, 100));

Meta