EDIT 2 Example:
You can download Mr Pointer's material-colors gamut data here: http://www.cis.rit.edu/mcsl/online/cie.php
This database is my source for the CIE x,y
coordinates of the spctral colors at a resolution of 1 nm (the spectrum locus)
The most simple way to render spectra + white light at the maximal saturation (or highest chroma) level is pick a white light (either illuminant D75, D65, D50, or C, or anything else you have at your disposal...)
I take D65, which has normalized CIE XYZ
coordinates:
X = 95.047
Y = 100
Z = 108.883
Then I take all the xy
coordinates of the spectrum locus
and I transform them in normalized XYZ
with the Y
value given by the Y colorimetric function multiplied by the D65 curve
(so this is the D65
spectrum), and normalized at: Ymax = Y 555nm = 100
Finally, I average the two values (XYZ D65)*a
and (XYZ locus)*b
, with a, b
being weighted such as the RGB conversion of the result will have: min R or/and min G or/and min B = 0
and max R or/and max G or/and max B = 255
That's the basic idea