I was looking for a way to generate colors based on a single number and came across a FORTRAN program that converted a visible wavelength into its RGB components. I converted this into java to use for my needs.
Due to the browsers not supporting NPAPI, you will need to download the jar file ColorSpectrum.jar and run it which requires Java to be installed on your machine.