Is there an algorithm to find out the wavelength of the color given the hue value (between 0 degree to 360 degree). Is there any built-in function in MATLABfor the same?
Hue is the wavelength within the visible-light spectrum at which the energy output from a source is greatest. This is shown as the peak of the curves of intensity in Figure 2. In this example, all three colors have the same hue in the yellow-green portion of the spectrum.
Hue is the perceptual dimension associated with color names. Typically, we use different hues to represent different categories of data. Figure 4.1: An example of eight different hues. Hues are associated with color names such as green, red or blue.
Hue is determined by the dominant wavelength of the visible spectrum. It is the attribute that permits colors to be classified as red, yellow, green, blue, or an intermediate color. Saturation pertains the amount of white light mixed with a hue.
The wavelength of visible light determines the color that the light appears. Light with the longest wavelength appears red, and light with the shortest wavelength appears violet. In between are the wavelengths of all the other colors of light. A prism separates visible light into its different colors.
While Mark Ransom and Franco Callari are completely right that you cannot recover the spectrum of a perceptual color, nor unambiguously map hue values to wavelengths, you could definitely piece something together if you just want the corresponding monochromatic wavelength.
The part of the hue cycle between 270 and 360 is another problem. There is nothing corresponding to pink or magenta in the light spectrum, so let's assume that we only use hue values between 0 and 270 degrees.
Estimating that the usable part of the visible spectrum is 400-650nm, with wavelength L
(in nm) and hue value H
(in degrees), you can improvise this:
L = 650 - 250 / 270 * H
650 is the maximum wavelength, 250 is the wavelength range and 270 is the hue range.
I think this should be in the right direction but there may of course be room for improvement. You might be able to get better results comparing between input hues and corresponding colors on a visible spectrum chart, and then adjusting the values somewhat.
It is possible to find the dominant wavelength of a color/hue. But as said most colors arn’t monochromatic and the same color can be constructed with different “mixes” of wavelengths. I.e. metamerism. Also, for the extra spectral magenta and violet colors only a complementary wavelength can be specified. I.e. the hue/dominant wavelength that additively mixes to white. Also white must be specified, since the is no absolute white due to adaption. Also psychologically our perception of hues doesn’t follow dominant hue lines. Se the Munsell and NCS systems.
Here you can calulate dominant wavelength from RGB values or different CIE systems: http://www.brucelindbloom.com/index.html?Calc.html I don’t have the formula though.
You can then transform RGB to/from HSL and similar. And to/from Munsell or NCS perceptual hues (NCS values are proprietary, so you have to pay and use their software).
Short answer: NO. A given hue can in general be produced by a triple infinity of wavelengths.
A "physical color" is a combination of pure spectral colors (in the visible range). In principle there exist infinitely many distinct spectral colors, and so the set of all physical colors may be thought of as an infinite-dimensional vector space (a Hilbert space). This space is typically notated Hcolor. More technically, the space of physical colors may be considered to be the topological cone over the simplex whose vertices are the spectral colors, with white at the centroid of the simplex, black at the apex of the cone, and the monochromatic color associated with any given vertex somewhere along the line from that vertex to the apex depending on its brightness.
. . .
This system implies that for any hue or non-spectral color not on the boundary of the chromaticity diagram, there are infinitely many distinct physical spectra that are all perceived as that hue or color. So, in general there is no such thing as the combination of spectral colors that we perceive as (say) a specific version of tan; instead there are infinitely many possibilities that produce that exact color. The boundary colors that are pure spectral colors can be perceived only in response to light that is purely at the associated wavelength, while the boundary colors on the "line of purples" can each only be generated by a specific ratio of the pure violet and the pure red at the ends of the visible spectral colors.
The CIE chromaticity diagram is horseshoe-shaped, with its curved edge corresponding to all spectral colors (the spectral locus), and the remaining straight edge corresponding to the most saturated purples, mixtures of red and violet.
(Source)
I cant provide simple solution, but there is something you need to consider:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With