3

I know there are some functions to work with XYZ color space, e.g. XYZColor, ColorConvert etc.. But I couldn't find any functions to calculate the color matching functions for CIE Standard Observers (2° and 10° ones).

Does Mathematica actually have such built-in functions, or should I continue using my own tabulations of them?

Ruslan
  • 7,152
  • 1
  • 23
  • 52

1 Answers1

5

The data points from 385 nm to 745 nm with 5 nm step are present in Mathematica, but are not directly accessible. This answer by Simon Woods explains how to access them:

(* Mention ChromaticityPlot function, otherwise the
   "Image`ColorOperationsDump`..." tables are not loaded *)
ChromaticityPlot;

(* Construct an interpolation function from the tables of
    wavelengths and tristimulus values *)
{x, y, z} = Interpolation[
   Thread[{Image`ColorOperationsDump`$wavelengths, #}]] & /@ 
   Transpose[Image`ColorOperationsDump`tris];

Plot[{x[λ], y[λ], z[λ]}, {λ, 385, 745}, PlotStyle -> {Red, Green, Blue}]

Output of the Plot command

Ruslan
  • 7,152
  • 1
  • 23
  • 52