The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



WavelengthToColor


Unit:SDL_sdlcolors
Class:none
Declaration:function WavelengthToColor (wl: integer; Gamma: double): TColor;

The function WavelengthToColor calculates the approximate color for a given walength. The parameter wl is the wavelength in nm, the parameter gamma specifies the gamma value of the monitor (typical gamma values are around 2.0). The following figure shows the color spectrum generated by WavelengthToColor using different gamma values.

Hint: Please note that the algorithm used in this function is not the one suggested by CIE (Commission Internationale Eclairage - International Lighting Commission). Instead a simplification published by Dan Bruton is used which results in a aesthetically more pleasing appearance of the spectrum.



Last Update: 2023-Feb-06