Color.Tristimulus
(Color v0.12.1)
Copy Markdown
Authoritative source of illuminant reference white data.
This module is the single source of truth for every CIE illuminant
the library supports — :A, :B, :C, :D50, :D55, :D65,
:D75, :E, :F2, :F7, :F11, plus the LED, ID and DCI series
— and for the two CIE standard observer angles (2 and 10). It
is consulted by:
Color.XYZ.adapt/3— chromatic adaptation between illuminants.Color.RGB.WorkingSpace— when computing the RGB→XYZ matrix for a working space, the illuminant's reference white feeds the Lindbloom primary-scaling step.Color.Lab,Color.Luv,Color.LCHab,Color.LCHuv,Color.XyY— every CIE-tagged colour space converts to XYZ relative to its illuminant's reference white.Color.Spectral— the integration normaliser uses the illuminant SPDs fromColor.Spectral.Tables, which are paired with the chromaticities defined here.
Reference whites for the 11 most common illuminants at the 2° observer come directly from Bruce Lindbloom's tables and are reproduced exactly. The remaining illuminants are computed from CIE 1931 / CIE 1964 chromaticities.
All values are returned as plain lists or tuples of float()
— the module has no Nx dependency.
Summary
Functions
Returns the supported CIE standard observer angles.
Returns the reference white for an illuminant as a three-element list
[Xr, Yr, Zr] of floats.
Returns the reference white for an illuminant as an {Xr, Yr, Zr} tuple
of plain floats, suitable for feeding into Color.Conversion.Lindbloom.
Functions
@spec observer_angles() :: [2 | 10]
Returns the supported CIE standard observer angles.
Examples
iex> Color.Tristimulus.observer_angles()
[2, 10]
Returns the reference white for an illuminant as a three-element list
[Xr, Yr, Zr] of floats.
Arguments
optionsis a keyword list.
Options
:illuminantdefaults to:D65.:observer_angledefaults to2.
Returns
- A list of three floats.
Returns the reference white for an illuminant as an {Xr, Yr, Zr} tuple
of plain floats, suitable for feeding into Color.Conversion.Lindbloom.
Arguments
optionsis a keyword list.
Options
:illuminantis the illuminant atom (for example:D65,:D50). Defaults to:D65.:observer_angleis the observer angle in degrees,2or10. Defaults to2.
Returns
- An
{Xr, Yr, Zr}tuple of floats.
Examples
iex> Color.Tristimulus.reference_white_tuple(illuminant: :D65)
{0.95047, 1.0, 1.08883}