How to model a light source using a spectral distribution curve for the color My previous attempt was unclear so I'm rephrasing the question:

I'm making a promo video for a certain type of lighting and at one point, I'd like to show the difference in the spectral power distribution (see graph below) of the light output for each type of bulb.  In other words, I want to use the SPD to color the light emitted by the bulb into the room based on wavelength and output power.

I have the SPD, I just need to use it somehow to color the emission source.  This is all I can think of but it's not exactly mathematical and I'm not sure it really captures a realistic representation and I don't know if it just basically averages the colors together:



It produces this light:



But I would rather have the emitted light follow a curve similar to this if at all possible:



Thanks for your help.
To accomplish this you would require a wavelength to XYZ conversion, and then from XYZ to sRGB / REC.709 primaries conversion.

Make sure that you obtain linearized RGB values from your wavelengths. If you are using normalized wavelengths, display linear (0.0 to 1.0) would suffice.