On clicking on the link at the bottom of this page a number of different synthetic spectra can be displayed. Currently you can select a continuous spectrum, a hydrogen absorption spectrum superimosed on a backbround continuum, and the emission spectra of several elements including hydrogen.
The spectra are generated by a series of merging colors that shade through from violet to red, in order to approximate what the eye sees by scanning over either 401 pixels at 1 nm per pixel or 801 pixels at 0.5 nm per pixel from 380 nm in the violet to 780 nm in the red. The absorption or emission lines are broadened with Lorentzian profiles. The large and small white tick marks indicate the wavelengths at 100 nm and 10 nm intervals respectively.
The source code of the file with the radio buttons to select the spectrum can be seen here, and the source code for drawing the selected spectrum can be seen here.
Sorry - unfortunately you do not have a compatible browser.
Click on the red arrow to see the spectrum.
Return to the Coding & Scripting main page.