Colors of the Visible Spectrum

Accurate computer display of the color and RGB values of a particular wavelength of the visible spectrum is an application of both color and vision science and color display technology. The spectrum incorporates the falloff in sensitivity of vision toward the short and long wavelength limits. The appearance of the spectrum changes depending on the color space used because of the different primary colors and white point of each color space. Unless your display is fairly color accurate, note that the spectrum image may appear degraded by banding; on a color-accurate display, the gradation in the image is smooth.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


The CIE 1931 chromaticity diagram is the locus of chromaticity coordinates for each visible wavelength . The chromaticity coordinates of the color space primaries are the vertices of the triangular region that determines the gamut of colors that can be represented in the color space.
For each wavelength , the chromaticity coordinates on the boundary of the color space triangular region are found as the intersection of the dominant wavelength line with the gamut boundary. (This scheme ignores that lines of constant hue are not straight.)
The gamut boundary chromaticity coordinates are converted to XYZ tristimulus values normalized to the Judd–Vos modified CIE 2-degree photopic luminosity curve, , as follows: .
The normalized XYZ tristimulus values are converted to RGB values using the color space XYZ RGB transformation matrix, the resulting RGB values are scaled so that the maximum value is 1, and finally RGB values are scaled by the color space transfer function (gamma adjustment).
For accurate appearance in a color-managed environment, the color space profile must be assigned to the resulting spectrum, for example, in Adobe Photoshop using Edit / Assign Profile. It does not appear to be possible to assign color space profiles within Mathematica.
[1] Adobe System Incorporated, "Adobe RGB (1968) Color Image Encoding," Version 2005-05. http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf.
[2] A. T. Young, "Rendering Spectra." (Sep 22, 2011) http://aty.sdsu.edu/explain/optics/rendering.html.
[3] A. T. Young, "What Color Is It?" (Sep 22, 2011) http://aty.sdsu.edu/explain/optics/color/color.html.
[4] C. Poynton, "A Guided Tour of Color Space." (Jul 14, 2015) http://www.poynton.com/PDFs/Guided_tour.pdf.
[5] R. W. G. Hunt, Measuring Colour, 3rd ed., Kingston-upon-Thames, England: Fountain Press, 1998.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+