在GTK程序中获取RGB颜色最直观的方法是用gdk_color_parse( const char* RGB_name, GdkColor *pcolor)函数,
RGB_name在RGB颜色表中查找,可以获得对应的GdkColor ,但是这样查找使用十分的不方便,
如何将Photoshop里的颜色板16位RGB颜色转换为对应的GdkColor 呢?!
GdkColor color;
if(gdk_color_parse("orange",&color))
{
printf("\n ***GTKcolor parse red[%d] green[%d] color[%d]*** \n",
color.red, color.green, color.blue);
}
orange R:FF G:A5 B:00 -> GdkColor { 0, FFFF, A5A5, 0000 }
是不是这个关系呢?!姑且试试。 试过之后还真TMD是这样……
不过 谁有空把第一个gulong pixel; 像素值干什么的解释一下……
struct GdkColor
{
gulong pixel; 像素值
gushort red;
gushort green;
gushort blue;
};
转网上查找到的RGB颜色表:http://www.iszhx.com/enHtml/News_50.html
RGB颜色表,RGB色谱 |
|
Add:hx0755AddTime:2009-2-19 11:33:08 Read:0Times |
顏色 |
英文名稱 |
RGB |
16色 |
|
Snow |
255 250 250 |
#FFFAFA |
|
GhostWhite |
248 248 255 |
#F8F8FF |
|
WhiteSmoke |
245 245 245 |
#F5F5F5 |
|
Gainsboro |
220 220 220 |
#DCDCDC |
|
FloralWhite |
255 250 240 |
#FFFAF0 |
|
OldLace |
253 245 230 |
#FDF5E6 |
|
Linen |
250 240 230 |
#FAF0E6 |
|
AntiqueWhite |
250 235 215 |
#FAEBD7 |
|
PapayaWhip |
255 239 213 |
#FFEFD5 |
|
BlanchedAlmond |
255 235 205 |
#FFEBCD |
|
Bisque |
255 228 196 |
#FFE4C4 |
|
PeachPuff |
255 218 185 |
#FFDAB9 |
|
NavajoWhite |
255 222 173 |
#FFDEAD |
|
Moccasin |
255 228 181 |
#FFE4B5 |
|
Cornsilk |
255 248 220 |
#FFF8DC |
|
Ivory |
255 255 240 |
#FFFFF0 |
|
LemonChiffon |
255 250 205 |
#FFFACD |
|
Seashell |
255 245 238 |
#FFF5EE |
|
Honeydew |
240 255 240 |
#F0FFF0 |
|
MintCream |
245 255 250 |
#F5FFFA |
|
Azure |
240 255 255 |
#F0FFFF |
|
AliceBlue |
240 248 255 |
#F0F8FF |
|
lavender |
230 230 250 |
#E6E6FA |
|
LavenderBlush |
255 240 245 |
#FFF0F5 |
|
MistyRose |
255 228 225 |
#FFE4E1 |
|
White |
255 255 255 |
#FFFFFF |
|
Black |
0 0 0 |
#000000 |
|
DarkSlateGray |
47 79 79 |
#2F4F4F |
|
DimGrey |
105 105 105 |
#696969 |
|
SlateGrey |
112 128 144 |
#708090 |
|
LightSlateGray |
119 136 153 |
#778899 |
|
Grey |
190 190 190 |
#BEBEBE |
|
LightGray |
211 211 211 |
#D3D3D3 |
|
MidnightBlue |
25 25 112 |
#191970 |
|
NavyBlue |
0 0 128 |
#000080 |
|
CornflowerBlue |
100 149 237 |
#6495ED |
|
DarkSlateBlue |
72 61 139 |
#483D8B |
|
SlateBlue |
106 90 205 |
#6A5ACD |
|
MediumSlateBlue |
123 104 238 |
#7B68EE |
|
LightSlateBlue |
132 112 255 |
#8470FF |
|
MediumBlue |
0 0 205 |
#0000CD |
|
RoyalBlue |
65 105 225 |
#4169E1 |
|
Blue |
0 0 255 |
#0000FF |
|
DodgerBlue |
30 144 255 |
#1E90FF |
|
DeepSkyBlue |
0 191 255 |
#00BFFF |
|
SkyBlue |
135 206 235 |
#87CEEB |
|
LightSkyBlue |
135 206 250 |
#87CEFA |
|
SteelBlue |
70 130 180 |
#4682B4 |
|
LightSteelBlue |
176 196 222 |
#B0C4DE |
|
LightBlue |
173 216 230 |
#ADD8E6 |
|
PowderBlue |
176 224 230 |
#B0E0E6 |
|
PaleTurquoise |
175 238 238 |
#AFEEEE |
|
DarkTurquoise |
0 206 209 |
#00CED1 |
|
MediumTurquoise |
72 209 204 |
#48D1CC |
|
Turquoise |
64 224 208 |
#40E0D0 |
|
Cyan |
0 255 255 |
#00FFFF |
|
LightCyan |
224 255 255 |
#E0FFFF |
|
CadetBlue |
95 158 160 |
#5F9EA0 |
|
MediumAquamarine |
102 205 170 |
#66CDAA |
|
Aquamarine |
127 255 212 |
#7FFFD4 |
|
DarkGreen |
0 100 0 |
#006400 |
|
DarkOliveGreen |
85 107 47 |
#556B2F |
|
DarkSeaGreen |
143 188 143 |
#8FBC8F |
|
SeaGreen |
46 139 87 |
#2E8B57 |
|
MediumSeaGreen |
60 179 113 |
#3CB371 |
|
LightSeaGreen |
32 178 170 |
#20B2AA |
|
|