Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Evaluate the CIE color matching functions for a given wavelength
ResourceFunction["CIEColorMatchingFunctionValues"][λ] evaluates the CIE color matching functions for a given wavelength λ. |
Evaluate the color matching functions for a given wavelength:
In[1]:= |
|
Out[1]= |
|
Get the corresponding color:
In[2]:= |
|
Out[2]= |
|
Plot the color matching functions:
In[3]:= |
|
Out[3]= |
|
Use any Quantity with length units:
In[4]:= |
|
Out[4]= |
|
Get the corresponding color:
In[5]:= |
|
Out[5]= |
|
CIEColorMatchingFunctionValues threads over lists:
In[6]:= |
|
Out[6]= |
|
Compare the color obtained from CIEColorMatchingFunctionValues with the color obtained from ColorData["VisibleSpectrum"]. There are slight differences, for example a narrower red band:
In[7]:= |
|
Out[7]= |
|
In[8]:= |
|
Out[8]= |
|
CIEColorMatchingFunctionValues is left unevaluated if the argument is a quantity with incompatible units:
In[9]:= |
|
Out[9]= |
|
Convert frequency to wavelength before giving it to CIEColorMatchingFunctionValues:
In[10]:= |
|
Out[10]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License