Color wave length and hue
36 次查看(过去 30 天)
显示 更早的评论
Is there any method to get color hue from its wave length?
0 个评论
采纳的回答
Walter Roberson
2011-9-29
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.)
3 个评论
Walter Roberson
2018-9-4
Sorry, I do not know, I did not write the code I linked to. I suspect the hue calculation given in that code might only be valid for colors in the range of red to blue, and that beyond that might start needing a different formula. The HSV and L*a*b* calculations are conditional based upon which component is strongest, and so calculating hue might get a bit complicated outside the noted range.
Nikhil R.
2020-12-5
Just a disclamer: I tried 400º wavelength, but got 342º hue, when I was expecting ~280º. I think something is wrong with the formula.
更多回答(1 个)
Nikhil R.
2020-12-5
编辑:Nikhil R.
2020-12-5
w = (400 / 270)h. You use this as a graph:
Edit: Note: This formula tries to get the closest possible to the same. Hue tends to be brighter as for example:
400nm/~270º
~265nm/~180º
~575nm/~390º
...
Table of official hues to wavelengths (Approximently):
Name Hue Wavelength
Red 0/360 650
Orange 45 600
Yellow 60 420
Lime 100 575
Cyan 180 475
Purple 270 400
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!