MATLAB: Color wave length and hue

colorconvert wavelength to huehueimage processingspectral analysiswavelength

Is there any method to get color hue from its wave length?

Best Answer

Hue = (650 - wavelength)*240/(650-475);
Note: the denominator consists of two seemingly arbitrary limits in the code. The 240 refers to the maximum hue value of 240 that is used in standard 8 bit Hue representation.
Visible light is about 400 to 700 nm, with 650 nm being the frequency of red. 475 is blue. Both indigo and violet fall below this limit, but the CIE model that defines the theoretical map of wavelength to hue has to treat colors in that range separately, and it could be that 475 nm is the effective limit for standard Hue calculation, perhaps requiring negative Hue (yes, that is possible in color theory, but not in standard 8 bit Hue representation.)
Related Question