Does anyone know of any formula for converting a light frequency to an RGB value?
I guess I might as well follow up my comment with a formal answer. The best option is to use the HSV colour space - though the hue represents the wavelength it is not a one-to-one comparison.