- Convert from RGB (or HSI) to a defined colour like "RED" or "BLUE"...
- Posted by JGG on May 23rd, 2005
Hi,
I have a color in RGB and in HSI, but i want to "translate" it to HUMAN
READABLE LANGUAGE.
Is there any function in C/win-api32 for that purpose?
Can I do that with any simple function?
Thanks.
- Posted by Jerry Coffin on May 24th, 2005
JGG wrote:
What exactly do you mean? In what reasonable way can I distinguish
between RGB(0, 0, 100) and RGB(0, 0, 101)? Without a direct,
side-by-side comparison, it's impossible to even distinguish between
the two, and describing the difference except in relative terms ("this
one _might_ be a little lighter blue than that one") is essentially
impossible. Human languages simply don't contain ways to reasonably
describe 16.7 milllion or more colors without either 1) inventing new
terminology that's likely to be denser than RGB or HSL numbers, or 2)
being vague to the point that thousands or millions of colors will all
be described identically.
--
Later,
Jerry.
The universe is a figment of its own imagination.
- Posted by JGG on May 24th, 2005
So...
I have to program a function that reads one color in RGB or HSI format
(maybe HSI will be better) and then the function return a value like
"RED", "BLUE", "GRAY", "BLACK",... the most common colours.
It's simple to return "RED" with values of Hue from 330º to 30º and a
value of "YELLOW" from 30º to 90ºof Hue.
But how Saturation and Value (Intensity) afect to that Hue?
thanks.
- Posted by Michel Bardiaux on May 24th, 2005
JGG wrote:
Euclidean distance) in a reference file.
E.g. rgb.txt in the X11R6 distribution (www.x.org) contains all these
variants of white:
248 248 255 ghost white
248 248 255 GhostWhite
245 245 245 white smoke
245 245 245 WhiteSmoke
255 250 240 floral white
255 250 240 FloralWhite
250 235 215 antique white
250 235 215 AntiqueWhite
255 222 173 navajo white
255 222 173 NavajoWhite
255 255 255 white
255 239 219 AntiqueWhite1
238 223 204 AntiqueWhite2
205 192 176 AntiqueWhite3
139 131 120 AntiqueWhite4
255 222 173 NavajoWhite1
238 207 161 NavajoWhite2
205 179 139 NavajoWhite3
139 121 94 NavajoWhite4
Since you're probably not interested in installing X11R6 (an essentially
Unix thing with which you may not be familiar) you can simply download
the file from
http://ngwww.ucar.edu/ngdoc/ng/ref/rgb.txt
HaND,
--
Michel Bardiaux
Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
Tel : +32 2 790.29.41