如何从它的rgb值获取颜色名称 [英] How to get color names from its rgb value

查看:1243
本文介绍了如何从它的rgb值获取颜色名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一个程序来获取颜色的名称。我可以得到像素的rgb值,但找不到如何得到它的名称。
是否有任何c ++库可以从其rgb值获取颜色的名称?
或者找到最匹配的颜色名称?

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?

推荐答案

除了 HTML颜色表,还有 RAL标准,这是一个行业中使用的熟知系统。

Aside from HTML color tables, there's also the RAL standard, a well known system used in the industry.

基本上,需要的是代码表,其中包含名称和RGB值。只要表格的分辨率和频谱足够,就可以很容易地找到最接近匹配的颜色名称:

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

一个简单的 CSV阅读器,加载颜色表可能是一个解决方案。

A simple CSV reader, to load the color tables may be a solution.

这篇关于如何从它的rgb值获取颜色名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆