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
 R. W. G. Hunt, Measuring Colour
, 3rd ed., Kingston-upon-Thames, England: Fountain Press, 1998.