I'm writing a program to get the name of a color. I can get the rgb value of the pixel, but couldn't find out how to get its name. Is there any c++ library that can get the name of a color from its rgb value? Or find the closest matching color name?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Aside from HTML color tables, there's also the RAL standard, a well known system used in the industry.
What one would need is basically the code table with names and RGB values. One can easily find the closest match for the appropriate color name, as long as the table's resolution and spectrum is sufficient:
- http://www.ralcolor.com/
- http://www.gobias.com/convert-ral-to-rgb.html
- http://en.wikipedia.org/wiki/List_of_colors
A simple CSV reader, to load the color tables may be a solution.