The code in the article linked by Alexey produces something similar to this (gradient plot inspired by J.M.'s comment) :

Note though that the description of the code does not seem consistent too me, so I had to change it in some places to get this result. Still I hope that I transcribed it more or less correctly. (I wouldn't use this for scientific purposes though!)
The code that creates the above figure is given below.
rgbSpec[x_] :=
RGBColor@@Piecewise[{
{{19/100 + 19/3000 (410 - x), 0, 1 - 6/300 (410 - x)}, 380 <= x < 410},
{{19/3000 (440 - x), 0, 1}, 410 <= x < 440},
{{0, 1 - (490 - x)/50, 1}, 440 <= x < 490},
{{0, 1, (510 - x)/20}, 490 <= x < 510},
{{1 - (580 - x)/70, 1, 0},510 <= x < 580},
{{1, (640 - x)/60, 0}, 580 <= x < 640},
{{1, 0, 0}, 640 <= x < 700},
{{35/100 + 65/8000 (780 - x), 0, 0}, 700 <= x <= 780}}]
(*rgb components*)
Plot[{rgbSpec[x][[1]], rgbSpec[x][[2]], rgbSpec[x][[3]]}, {x,380,780}, PlotStyle -> {Red, Green, Blue}, PlotRange -> All, Frame -> True]
(*gradient plot*)
DensityPlot[x, {x, 380, 780}, {y, 0, 1}, ColorFunction -> (rgbSpec[#] &), ColorFunctionScaling -> False,AspectRatio -> 1/10, FrameTicks -> {{None, None}, {Automatic, None}},Frame -> Automatic, PlotRangePadding -> None]
(If someone actually bothers to check, feel free to correct any mistakes!)
Yellowcolor when using such a function with its argument set to yellow wavelength? There already is the built-in color mapping and it works pretty well. – Alexey Popkov Oct 3 '12 at 14:58