C 图像处理 颜色相关宏定义

      很多年前整理的,像素处理的宏定义,包括r8g8b8到r5g6b5之间的相互转化,浮点数像素与整数值之间的相互转化,像素值的插值、取反等处理。具体没什么好说的,宏定义的代码还是很容易看的。这套东西对搞图像处理的来说非常有意义。

  1 /****************************************************************
  2 
  3   File name   :  WhyColorDefines.h
  4   Author      :  叶飞影
  5   Version     :  2.0
  6   Create Date :  2010/08/05   
  7   Description :  颜色相关宏定义
  8 
  9 *****************************************************************/
 10 
 11 #ifndef __WhyColorDefines_H__
 12 #define __WhyColorDefines_H__
 13 
 14 // INCLUDES -----------------------------------------------------------------------------
 15 
 16 #include "WhyDefines.h"
 17 
 18 // --------------------------------------------------------------------------------------
 19 
 20 enum YePixelType
 21 {
 22     YE_PT_INVALID               = 0,
 23     YE_PT_GRAY_8                = 1,
 24     YE_PT_A8R8G8B8              = 2,
 25     YE_PT_R8G8B8                = 3,
 26     YE_PT_A1R5G5B5              = 4,
 27     YE_PT_R5G6B5                = 5,
 28     YE_PT_A4R4G4B4              = 6,
 29 };
 30 
 31 // --------------------------------------------------------------------------------------
 32 
 33 #define YD_INT_TO_BYTE(x)       ( (x) < 0 ? 0 : (((x) > 255) ? 255 : (x)) )
 34 #define YD_REAL_TO_BYTE(x)      ( (x) < 0 ? 0 : (((x) > 1.0f) ? 255 : (Ybyte)((x) * 255)) )
 35 #define YD_BYTE_TO_REAL(x)      ( (x) * 0.00392156862745f);           // x / 255
 36 
 37 // --------------------------------------------------------------------------------------
 38 
 39 /*****A8R8G8B8*****/
 40 
 41 // 通过R,G,B生成一整数表示颜色
 42 #define YD_RGB(r,g,b)                                   \
 43 ( (Ycolor) ( (Ybyte)(b) |                               \
 44              ( (Ycolor(Ybyte(g))) << 8 ) |              \
 45              ( (Ycolor(Ybyte(r))) << 16 ) |             \
 46              0xff000000 )                               \
 47 )
 48 
 49 // 通过R,G,B,A生成一整数表示颜色
 50 #define YD_ARGB(a,r,g,b)                                \
 51 ( (Ycolor) ( (Ybyte)(b) |                               \
 52              ( (Ycolor(Ybyte(g))) << 8 ) |              \
 53              ( (Ycolor(Ybyte(r))) << 16 ) |             \
 54              ( (Ycolor(Ybyte(a))) << 24 ) )             \
 55 )
 56 
 57 // 交换R分量与B分量
 58 #define YD_SWITCH_R_B(color)                            \
 59 {                                                       \
 60     Ycolor a = YD_GET_A(color);                         \
 61     Ycolor r = YD_GET_R(color);                         \
 62     Ycolor g = YD_GET_G(color);                         \
 63     Ycolor b = YD_GET_B(color);                         \
 64     color = YD_ARGB(a,b,g,r);                           \
 65 }
 66 
 67 // 修改A分量
 68 #define YD_COLOR_ALPHA(color, alpha)                    \
 69 {                                                       \
 70     Yuint a = YD_GET_A(color);                          \
 71     a = (Yuint)(a*alpha);                               \
 72     color &= 0x00ffffff;                                \
 73     color |= (a << 24);                                 \
 74 }
 75 
 76 #define YD_GET_A(color)         ( ((color) & 0xff000000) >> 24L )
 77 #define YD_GET_R(color)         ( ((color) & 0x00ff0000) >> 16L )
 78 #define YD_GET_G(color)         ( ((color) & 0x0000ff00) >> 8L )
 79 #define YD_GET_B(color)         ( ((color) & 0x000000ff) )
 80 
 81 #define YD_GET_ARGB(color, a, r, g, b)                  \
 82 {                                                       \
 83     a = YD_GET_A(color);                                \
 84     r = YD_GET_R(color);                                \
 85     g = YD_GET_G(color);                                \
 86     b = YD_GET_B(color);                                \
 87 }
 88 
 89 // 颜色各分量的平均值
 90 #define YD_ARGB_AVERAGE(color1, color2, colorDest)      \
 91 {                                                       \
 92     Ycolor a1, r1, g1, b1;                              \
 93     Ycolor a2, r2, g2, b2;                              \
 94     Ycolor ad, rd, gd, bd;                              \
 95     YD_GET_ARGB(color1, a1, r1, g1, b1);                \
 96     YD_GET_ARGB(color2, a2, r2, g2, b2);                \
 97     ad = (a1 + a2) / 2;                                 \
 98     rd = (r1 + r2) / 2;                                 \
 99     gd = (g1 + g2) / 2;                                 \
100     bd = (b1 + b2) / 2;                                 \
101     colorDest = YD_ARGB(ad, rd, gd, bd);                \
102 }
103 
104 // 颜色各分量的线性插值
105 #define YD_ARGB_LERP(color1, color2, colorDest, radio)  \
106 {                                                       \
107     Ycolor a1, r1, g1, b1;                              \
108     Ycolor a2, r2, g2, b2;                              \
109     Ycolor ad, rd, gd, bd;                              \
110     YD_GET_ARGB(color1, a1, r1, g1, b1);                \
111     YD_GET_ARGB(color2, a2, r2, g2, b2);                \
112     ad = (Ycolor)YD_LERP(a1, a2, radio);                \
113     rd = (Ycolor)YD_LERP(r1, r2, radio);                \
114     gd = (Ycolor)YD_LERP(g1, g2, radio);                \
115     bd = (Ycolor)YD_LERP(b1, b2, radio);                \
116     colorDest = YD_ARGB(ad, rd, gd, bd);                \
117 }
118 
119 #define YD_GET_RGB(color, r, g, b)                      \
120 {                                                       \
121     r = YD_GET_R(color);                                \
122     g = YD_GET_G(color);                                \
123     b = YD_GET_B(color);                                \
124 }
125 
126 #define YD_RGB_AVERAGE(color1, color2, colorDest)       \
127 {                                                       \
128     Ycolor r1, g1, b1;                                  \
129     Ycolor r2, g2, b2;                                  \
130     Ycolor rd, gd, bd;                                  \
131     YD_GET_RGB(color1, r1, g1, b1);                     \
132     YD_GET_RGB(color2, r2, g2, b2);                     \
133     rd = (r1 + r2) / 2;                                 \
134     gd = (g1 + g2) / 2;                                 \
135     bd = (b1 + b2) / 2;                                 \
136     colorDest = YD_RGB(rd, gd, bd);                     \
137 }
138 
139 // 颜色各分量的线性插值
140 #define YD_RGB_LERP(color1, color2, colorDest, radio)   \
141 {                                                       \
142     Yuint32 r1, g1, b1;                                 \
143     Yuint32 r2, g2, b2;                                 \
144     Yuint32 rd, gd, bd;                                 \
145     YD_GET_RGB(color1, r1, g1, b1);                     \
146     YD_GET_RGB(color2, r2, g2, b2);                     \
147     rd = (Yuint32)YD_LERP(r1, r2, radio);               \
148     gd = (Yuint32)YD_LERP(g1, g2, radio);               \
149     bd = (Yuint32)YD_LERP(b1, b2, radio);               \
150     colorDest = YD_RGB(ad, rd, gd, bd);                 \
151 }
152 
153 // 颜色缩放
154 #define YD_COLOR_SCALE(colorDest, color, scale)         \
155 {                                                       \
156     Yuint32 a, r, g, b;                                 \
157     Yuint32 ad, rd, gd, bd;                             \
158     YD_GET_ARGB(color, a, r, g, b);                     \
159     rd = (Yuint32)(r*scale);                            \
160     gd = (Yuint32)(g*scale);                            \
161     bd = (Yuint32)(b*scale);                            \
162     ad = (Yuint32)(a*scale);                            \
163     colorDest = YD_ARGB(ad, rd, gd, bd);                \
164 }
165 
166 #define YD_COLOR_RGB_SCALE(colorDest, color, scale)     \
167 {                                                       \
168     Yuint32 a, r, g, b;                                 \
169     Yuint32 rd, gd, bd;                                 \
170     YD_GET_ARGB(color, a, r, g, b);                     \
171     rd = (Yuint32)(r*scale);                            \
172     gd = (Yuint32)(g*scale);                            \
173     bd = (Yuint32)(b*scale);                            \
174     colorDest = YD_ARGB(a, rd, gd, bd);                 \
175 }
176 
177 #define YD_COLOR_ALPHA_SCALE(colorDest, color, scale)   \
178 {                                                       \
179     Yuint32 a, r, g, b;                                 \
180     Yuint32 ad;                                         \
181     YD_GET_ARGB(color, a, r, g, b);                     \
182     ad = (Yuint32)(a*scale);                            \
183     colorDest = YD_ARGB(ad, r, g, b);                   \
184 }
185 
186 // 颜色置反
187 #define YD_COLOR_INVERSE(colorDest, color)              \
188 {                                                       \
189     Yuint32 a, r, g, b;                                 \
190     Yuint32 ad, rd, gd, bd;                             \
191     YD_GET_ARGB(color, a, r, g, b);                     \
192     rd = 255 - r;                                       \
193     gd = 255 - g;                                       \
194     bd = 255 - b;                                       \
195     ad = 255 - a;                                       \
196     colorDest = YD_ARGB(ad, rd, gd, bd);                \
197 }
198 
199 #define YD_COLOR_RGB_INVERSE(colorDest, color)          \
200 {                                                       \
201     Yuint32 a, r, g, b;                                 \
202     Yuint32 rd, gd, bd;                                 \
203     YD_GET_ARGB(color, a, r, g, b);                     \
204     rd = 255 - r;                                       \
205     gd = 255 - g;                                       \
206     bd = 255 - b;                                       \
207     colorDest = YD_ARGB(a, rd, gd, bd);                 \
208 }
209 
210 #define YD_COLOR_ALPHA_INVERSE(colorDest, color)        \
211 {                                                       \
212     Yuint32 a, r, g, b;                                 \
213     Yuint32 ad;                                         \
214     YD_GET_ARGB(color, a, r, g, b);                     \
215     ad = 255 - a;                                       \
216     colorDest = YD_ARGB(ad, r, g, b);                   \
217 }
218 
219 // --------------------------------------------------------------------------------------
220 
221 /*****R5G6B5*****/
222 
223 #define YD_R5G6B5(r,g,b)                                \
224 ( (YWord) ( ( (Ybyte(b) >> 3L) ) |                      \
225             ( (YWord(Ybyte(g)) >> 2L) << 5L ) |         \
226             ( (YWord(Ybyte(r)) >> 3L) << 11L )          \
227 )
228 
229 #define YD_GET_565_R(color)     ( ((color) & 0x0000f800) >> 8L )
230 #define YD_GET_565_G(color)     ( ((color) & 0x000007E0) >> 3L )
231 #define YD_GET_565_B(color)     ( ((color) & 0x0000001f) << 3L )
232 
233 #define YD_GET_565_RGB(color, r, g, b)                  \
234 {                                                       \
235     r = YD_GET_565_R(color);                            \
236     g = YD_GET_565_G(color);                            \
237     b = YD_GET_565_B(color);                            \
238 }
239 
240 // --------------------------------------------------------------------------------------
241 
242 /*****A1R5G5B5*****/
243 
244 #define YD_R5G5B5(r,g,b)                                \
245 ( (YWord) ( ( (Ybyte(b) >> 3L) ) |                      \
246             ( (YWord(Ybyte(g)) >> 3L) << 5L ) |         \
247             ( (YWord(Ybyte(r)) >> 3L) << 10L )          \
248 )
249 
250 #define YD_A1R5G5B5(a,r,g,b)                            \
251 ( (YWord) ( ( (Ybyte(b) >> 3L) ) |                      \
252             ( (YWord(Ybyte(g)) >> 3L) << 5L ) |         \
253             ( (YWord(Ybyte(r)) >> 3L) << 10L ) |        \
254             ( (YWord((a) & 1L) << 15L) )                \
255 )
256 
257 #define YD_GET_1555_A(color)    ( ((color) & 0x00008000) ? 255 : 0 )
258 #define YD_GET_1555_R(color)    ( ((color) & 0x00007B00) >> 7L )
259 #define YD_GET_1555_G(color)    ( ((color) & 0x000003E0) >> 2L )
260 #define YD_GET_1555_B(color)    ( ((color) & 0x0000001f) << 3L )
261 
262 #define YD_GET_1555_RGB(color, a, r, g, b)              \
263 {                                                       \
264     a = YD_GET_1555_A(color);                           \
265     r = YD_GET_1555_R(color);                           \
266     g = YD_GET_1555_G(color);                           \
267     b = YD_GET_1555_B(color);                           \
268 }
269 
270 // --------------------------------------------------------------------------------------
271 
272 /*****A4R4G4B4*****/
273 
274 #define YD_R4G4B4(r,g,b)                                \
275 ( (YWord) ( ( (Ybyte(b) >> 4L) ) |                      \
276             ( (YWord(Ybyte(g)) >> 4L) << 4L ) |         \
277             ( (YWord(Ybyte(r)) >> 4L) << 8L ) )         \
278 )
279 
280 #define YD_A4R4G4B4(a,r,g,b)                            \
281 ( (YWord) ( ( (Ybyte(b) >> 4L) ) |                      \
282             ( (YWord(Ybyte(g)) >> 4L) << 4L ) |         \
283             ( (YWord(Ybyte(r)) >> 4L) << 8L ) |         \
284             ( (YWord(Ybyte(a)) >> 4L) << 12L ) )        \
285 )
286 
287 #define YD_GET_4444_A(color)    ( ((color) & 0x0000f000) >> 8L )
288 #define YD_GET_4444_R(color)    ( ((color) & 0x00000f00) >> 4L )
289 #define YD_GET_4444_G(color)    ( ((color) & 0x000000f0) )
290 #define YD_GET_4444_B(color)    ( ((color) & 0x0000000f) << 4L )
291 
292 #define YD_GET_4444_RGB(color, a, r, g, b)              \
293 {                                                       \
294     a = YD_GET_4444_A(color);                           \
295     r = YD_GET_4444_R(color);                           \
296     g = YD_GET_4444_G(color);                           \
297     b = YD_GET_4444_B(color);                           \
298 }
299 
300 // --------------------------------------------------------------------------------------
301 
302 union YColorARGB
303 {
304     struct
305     {
306         Ybyte   b;
307         Ybyte   g;
308         Ybyte   r;        
309         Ybyte   a;        
310     };
311 
312     Ycolor      dwColor;
313 };
314 
315 struct YColorRGB
316 {
317     Ybyte       b;
318     Ybyte       g;
319     Ybyte       r;        
320 };
321 
322 struct YsFloatColor
323 {
324     Yreal       fAlpha;
325     Yreal       fRed;
326     Yreal       fGreen;
327     Yreal       fBlue;
328 };
329 
330 #define YD_R5G6B5_TO_R8G8B8(src565, dest888)            \
331 {                                                       \
332     Ycolor r, g, b;                                     \
333     YD_GET_565_RGB(src565, r, g, b);                    \
334     dest888 = YD_RGB(r, g, b);                          \
335 }
336 
337 #define YD_R8G8B8_TO_R5G6B5(src888, dest565)            \
338 {                                                       \
339     Ycolor r, g, b;                                     \
340     YD_GET_RGB(src888, r, g, b);                        \
341     dest565 = YD_R5G6B5(r, g, b);                       \
342 }
343 
344 #define YD_A1R5G5B5_TO_A8R8G8B8(src1555, dest8888)      \
345 {                                                       \
346     Ycolor a, r, g, b;                                  \
347     YD_GET_1555_RGB(src1555, a, r, g, b);               \
348     dest8888 = YD_ARGB(a, r, g, b);                     \
349 }
350 
351 #define YD_A8R8G8B8_TO_A1R5G5B5(src8888, dest1555)      \
352 {                                                       \
353     Ycolor a, r, g, b;                                  \
354     YD_GET_ARGB(src8888, a, r, g, b);                   \
355     dest1555 = YD_A1R5G5B5(a, r, g, b);                 \
356 }
357 
358 #define YD_A4R4G4B4_TO_A8R8G8B8(src4444, dest8888)      \
359 {                                                       \
360     Ycolor a, r, g, b;                                  \
361     YD_GET_4444_RGB(src4444, a, r, g, b);               \
362     dest8888 = YD_ARGB(a, r, g, b);                     \
363 }
364 
365 #define YD_A8R8G8B8_TO_A4R4G4B4(src8888, dest4444)      \
366 {                                                       \
367     Ycolor a, r, g, b;                                  \
368     YD_GET_ARGB(src8888, a, r, g, b);                   \
369     dest4444 = YD_A4R4G4B4(a, r, g, b);                 \
370 }
371 
372 #define YD_R8G8B8_TO_A8R8G8B8(src888, dest8888)             \
373 {                                                           \
374     dest8888 = YD_ARGB(255, src888.r, src888.g, src888.b);  \
375 }
376 
377 #define YD_A8R8G8B8_TO_R8G8B8(src8888, dest888)             \
378 {                                                           \
379     YD_GET_RGB(src8888, dest888.r, dest888.g, dest888.b);   \
380 }
381 
382 #define YD_FLOATCOLOR_TO_A8R8G8B8(srcFloatColor, dest8888)  \
383 {                                                           \
384     Ybyte a = YD_REAL_TO_BYTE(srcFloatColor.fAlpha);        \
385     Ybyte r = YD_REAL_TO_BYTE(srcFloatColor.fRed);          \
386     Ybyte g = YD_REAL_TO_BYTE(srcFloatColor.fGreen);        \
387     Ybyte b = YD_REAL_TO_BYTE(srcFloatColor.fBlue);         \
388     dest8888 = YD_ARGB(a, r, g, b);                         \
389 }
390 
391 #define YD_A8R8G8B8_TO_FLOATCOLOR(src8888, destFloatColor)  \
392 {                                                           \
393     Ycolor a, r, g, b;                                      \
394     YD_GET_ARGB(src8888, a, r, g, b);                       \
395     srcFloatColor.fAlpha = YD_BYTE_TO_REAL(a);              \
396     srcFloatColor.fRed   = YD_BYTE_TO_REAL(r);              \
397     srcFloatColor.fGreen = YD_BYTE_TO_REAL(g);              \
398     srcFloatColor.fBlue  = YD_BYTE_TO_REAL(b);              \
399 }
400 
401 // --------------------------------------------------------------------------------------
402 
403 #define YD_COLOR_LIGHT_PINK             YD_RGB(255, 182, 193)        // 浅粉红
404 #define YD_COLOR_PINK                   YD_RGB(255, 192, 203)        // 粉红
405 #define YD_COLOR_CRIMSON_RED            YD_RGB(220,  20,  60)        // 猩红 (深红)
406 #define YD_COLOR_LAVENDER_BLUSH         YD_RGB(255, 240, 245)        // 淡紫红
407 #define YD_COLOR_PALE_VIOLET_RED        YD_RGB(219, 112, 147)        // 弱紫罗兰红
408 #define YD_COLOR_HOT_PINK               YD_RGB(255, 105, 180)        // 热情的粉红
409 #define YD_COLOR_DEEP_PINK              YD_RGB(255,  20, 147)        // 深粉红
410 #define YD_COLOR_MEDIUM_VIOLET_RED      YD_RGB(199,  21, 133)        // 中紫罗兰红
411 #define YD_COLOR_ORCHID                 YD_RGB(218, 112, 214)        // 兰花紫
412 #define YD_COLOR_THISTLE                YD_RGB(216, 191, 216)        //
413 #define YD_COLOR_PLUM                   YD_RGB(221, 160, 221)        // 李子紫
414 #define YD_COLOR_VIOLET                 YD_RGB(238, 130, 238)        // 紫罗兰
415 #define YD_COLOR_MAGENTA                YD_RGB(255,   0, 255)        // 洋红 (品红 玫瑰红)
416 #define YD_COLOR_FUCHSIA                YD_RGB(255,   0, 255)        // 灯笼海棠(紫红色)
417 #define YD_COLOR_DARK_MAGENTA           YD_RGB(139,   0, 139)        // 深洋红
418 #define YD_COLOR_PURPLE                 YD_RGB(128,   0, 128)        // 紫色
419 #define YD_COLOR_MEDIUM_ORCHID          YD_RGB(186,  85, 211)        // 中兰花紫
420 #define YD_COLOR_DARK_VIOLET            YD_RGB(148,   0, 211)        // 暗紫罗兰
421 #define YD_COLOR_DARK_ORCHID            YD_RGB(153,  50, 204)        // 暗兰花紫
422 #define YD_COLOR_INDIGO                 YD_RGB( 75,   0, 130)        // 靛青 (紫兰色)
423 #define YD_COLOR_BLUE_VIOLET            YD_RGB(138,  43, 226)        // 蓝紫罗兰
424 #define YD_COLOR_MEDIUM_PURPLE          YD_RGB(147, 112, 219)        // 中紫色
425 #define YD_COLOR_MEDIUM_SLATE_BLUE      YD_RGB(123, 104, 238)        // 中板岩蓝
426 #define YD_COLOR_SLATE_BLUE             YD_RGB(106,  90, 205)        // 板岩蓝
427 #define YD_COLOR_DARK_SLATE_BLUE        YD_RGB( 72,  61, 139)        // 暗板岩蓝
428 #define YD_COLOR_LAVENDER               YD_RGB(230, 230, 250)        // 熏衣草淡紫
429 #define YD_COLOR_GHOST_WHITE            YD_RGB(248, 248, 255)        // 幽灵白
430 #define YD_COLOR_BLUE                   YD_RGB(  0,   0, 255)        // 纯蓝
431 #define YD_COLOR_MEDIUM_BLUE            YD_RGB(  0,   0, 205)        // 中蓝色
432 #define YD_COLOR_MIDNIGHT_BLUE          YD_RGB( 25,  25, 112)        // 午夜蓝
433 #define YD_COLOR_DARK_BLUE              YD_RGB(  0,   0, 139)        // 暗蓝色
434 #define YD_COLOR_NAVY_BLUE              YD_RGB(  0,   0, 128)        // 海军蓝
435 #define YD_COLOR_ROYAL_BLUE             YD_RGB( 65, 105, 225)        // 皇家蓝 (宝蓝)
436 #define YD_COLOR_CORN_FLOWER_BLUE       YD_RGB(100, 149, 237)        // 矢车菊蓝
437 #define YD_COLOR_LIGHT_STEEL_BLUE       YD_RGB(176, 196, 222)        // 亮钢蓝
438 #define YD_COLOR_LIGHT_SLATE_GRAY       YD_RGB(119, 136, 153)        // 亮石板灰
439 #define YD_COLOR_SLATE_GRAY             YD_RGB(112, 128, 144)        // 石板灰
440 #define YD_COLOR_DODGER_BLUE            YD_RGB( 30, 144, 255)        // 道奇蓝
441 #define YD_COLOR_ALICE_BLUE             YD_RGB(240, 248, 255)        // 爱丽丝蓝
442 #define YD_COLOR_STEEL_BLUE             YD_RGB( 70, 130, 180)        // 钢蓝 (铁青)
443 #define YD_COLOR_LIGHT_SKY_BLUE         YD_RGB(135, 206, 250)        // 亮天蓝色
444 #define YD_COLOR_SKY_BLUE               YD_RGB(135, 206, 235)        // 天蓝色
445 #define YD_COLOR_DEEP_SKY_BLUE          YD_RGB(  0, 191, 255)        // 深天蓝
446 #define YD_COLOR_LIGHT_BLUE             YD_RGB(173, 216, 230)        // 亮蓝
447 #define YD_COLOR_POWDER_BLUE            YD_RGB(176, 224, 230)        // 火药青
448 #define YD_COLOR_CADET_BLUE             YD_RGB( 95, 158, 160)        // 军服蓝
449 #define YD_COLOR_AZURE                  YD_RGB(240, 255, 255)        // 蔚蓝色
450 #define YD_COLOR_LIGHT_CYAN             YD_RGB(224, 255, 255)        // 淡青色
451 #define YD_COLOR_PALE_TURQUOISE         YD_RGB(175, 238, 238)        // 弱绿宝石
452 #define YD_COLOR_CYAN                   YD_RGB(  0, 255, 255)        // 青色
453 #define YD_COLOR_AQUA                   YD_RGB(  0, 255, 255)        // 水色
454 #define YD_COLOR_DARK_TURQUOISE         YD_RGB(  0, 206, 209)        // 暗绿宝石
455 #define YD_COLOR_DARK_SLATE_GRAY        YD_RGB( 47,  79,  79)        // 暗石板灰
456 #define YD_COLOR_DARK_CYAN              YD_RGB(  0, 139, 139)        // 暗青色
457 #define YD_COLOR_TEAL                   YD_RGB(  0, 128, 128)        // 水鸭色
458 #define YD_COLOR_MEDIUM_TURQUOISE       YD_RGB( 72, 209, 204)        // 中绿宝石
459 #define YD_COLOR_LIGHT_SEA_GREEN        YD_RGB( 32, 178, 170)        // 浅海洋绿
460 #define YD_COLOR_TURQUOISE              YD_RGB( 64, 224, 208)        // 绿宝石
461 #define YD_COLOR_AQUAMARINE             YD_RGB(127, 255, 212)        // 宝石碧绿
462 #define YD_COLOR_MEDIUM_AQUAMARINE      YD_RGB(102, 205, 170)        // 中宝石碧绿
463 #define YD_COLOR_MEDIUM_SPRINGGREEN     YD_RGB(  0, 250, 154)        // 中春绿色
464 #define YD_COLOR_MINT_CREAM             YD_RGB(245, 255, 250)        // 薄荷奶油
465 #define YD_COLOR_SPRING_GREEN           YD_RGB(  0, 255, 127)        // 春绿色
466 #define YD_COLOR_MEDIUM_SEA_GREEN       YD_RGB( 60, 179, 113)        // 中海洋绿
467 #define YD_COLOR_SEA_GREEN              YD_RGB( 46, 139,  87)        // 海洋绿
468 #define YD_COLOR_HONEYDEW               YD_RGB(240, 255, 240)        // 蜜瓜色
469 #define YD_COLOR_LIGHT_GREEN            YD_RGB(144, 238, 144)        // 淡绿色
470 #define YD_COLOR_PALE_GREEN             YD_RGB(152, 251, 152)        // 弱绿色
471 #define YD_COLOR_DARK_SEA_GREEN         YD_RGB(143, 188, 143)        // 暗海洋绿
472 #define YD_COLOR_LIME_GREEN             YD_RGB( 50, 205,  50)        // 闪光深绿
473 #define YD_COLOR_LIME                   YD_RGB(  0, 255,   0)        // 闪光绿
474 #define YD_COLOR_FOREST_GREEN           YD_RGB( 34, 139,  34)        // 森林绿
475 #define YD_COLOR_GREEN                  YD_RGB(  0, 128,   0)        // 纯绿
476 #define YD_COLOR_DARK_GREEN             YD_RGB(  0, 100,   0)        // 暗绿色
477 #define YD_COLOR_CHARTREUSE             YD_RGB(127, 255,   0)        // 查特酒绿 (黄绿色)
478 #define YD_COLOR_LAWN_GREEN             YD_RGB(124, 252,   0)        // 草坪绿
479 #define YD_COLOR_GREEN_YELLOW           YD_RGB(173, 255,  47)        // 绿黄色
480 #define YD_COLOR_DARK_OLIVE_GREEN       YD_RGB( 85, 107,  47)        // 暗橄榄绿
481 #define YD_COLOR_YELLOW_GREEN           YD_RGB(154, 205,  50)        // 黄绿色
482 #define YD_COLOR_OLIVE_DRAB             YD_RGB(107, 142,  35)        // 橄榄褐色
483 #define YD_COLOR_BEIGE                  YD_RGB(245, 245, 220)        // 米色(灰棕色)
484 #define YD_COLOR_LIGHT_GOLDENROD_YELLOW YD_RGB(250, 250, 210)        // 亮菊黄
485 #define YD_COLOR_IVORY                  YD_RGB(255, 255, 240)        // 象牙
486 #define YD_COLOR_LIGHT_YELLOW           YD_RGB(255, 255, 224)        // 浅黄色
487 #define YD_COLOR_YELLOW                 YD_RGB(255, 255,   0)        // 纯黄
488 #define YD_COLOR_OLIVE                  YD_RGB(128, 128,   0)        // 橄榄
489 #define YD_COLOR_DARK_KHAKI             YD_RGB(189, 183, 107)        // 深卡叽布
490 #define YD_COLOR_LEMON_CHIFFON          YD_RGB(255, 250, 205)        // 柠檬绸
491 #define YD_COLOR_PALE_GOLDENROD         YD_RGB(238, 232, 170)        // 灰菊黄
492 #define YD_COLOR_KHAKI                  YD_RGB(240, 230, 140)        // 卡叽布
493 #define YD_COLOR_GOLD                   YD_RGB(255, 215,   0)        // 金色
494 #define YD_COLOR_CORNSILK               YD_RGB(255, 248, 220)        // 玉米丝色 
495 #define YD_COLOR_GOLDENROD              YD_RGB(218, 165,  32)        // 金菊黄 
496 #define YD_COLOR_DARK_GOLDENROD         YD_RGB(184, 134,  11)        // 暗金菊黄 
497 #define YD_COLOR_FLORAL_WHITE           YD_RGB(255, 250, 240)        // 花的白色 
498 #define YD_COLOR_OLD_LACE               YD_RGB(253, 245, 230)        // 旧蕾丝 
499 #define YD_COLOR_WHEAT                  YD_RGB(245, 222, 179)        // 小麦色 
500 #define YD_COLOR_MOCCASIN               YD_RGB(255, 228, 181)        // 鹿皮靴 
501 #define YD_COLOR_ORANGE                 YD_RGB(255, 165,   0)        // 橙色 
502 #define YD_COLOR_PAPAYA_WHIP            YD_RGB(255, 239, 213)        // 番木瓜 
503 #define YD_COLOR_BLANCHED_ALMOND        YD_RGB(255, 235, 205)        // 发白的杏仁色 
504 #define YD_COLOR_NAVAJO_WHITE           YD_RGB(255, 222, 173)        // 土著白 
505 #define YD_COLOR_ANTIQUE_WHITE          YD_RGB(250, 235, 215)        // 古董白 
506 #define YD_COLOR_TAN                    YD_RGB(210, 180, 140)        // 茶色 
507 #define YD_COLOR_BURLY_WOOD             YD_RGB(222, 184, 135)        // 硬木色 
508 #define YD_COLOR_BISQUE                 YD_RGB(255, 228, 196)        // 陶坯黄 
509 #define YD_COLOR_DARK_ORANGE            YD_RGB(255, 140,   0)        // 深橙色 
510 #define YD_COLOR_LINEN                  YD_RGB(250, 240, 230)        // 亚麻布 
511 #define YD_COLOR_PERU                   YD_RGB(205, 133,  63)        // 秘鲁 
512 #define YD_COLOR_PEACH_PUFF             YD_RGB(255, 218, 185)        // 桃肉色 
513 #define YD_COLOR_SANDY_BROWN            YD_RGB(244, 164,  96)        // 沙棕色 
514 #define YD_COLOR_CHOCOLATE              YD_RGB(210, 105,  30)        // 巧克力 
515 #define YD_COLOR_SADDLE_BROWN           YD_RGB(139,  69,  19)        // 马鞍棕色 
516 #define YD_COLOR_SEASHELL               YD_RGB(255, 245, 238)        // 海贝壳 
517 #define YD_COLOR_SIENNA                 YD_RGB(160,  82,  45)        // 黄土赭色 
518 #define YD_COLOR_LIGHT_SALMON           YD_RGB(255, 160, 122)        // 浅鲑鱼肉色 
519 #define YD_COLOR_CORAL                  YD_RGB(255, 127,  80)        // 珊瑚 
520 #define YD_COLOR_ORANGE_RED             YD_RGB(255,  69,   0)        // 橙红色 
521 #define YD_COLOR_DARK_SALMON            YD_RGB(233, 150, 122)        // 深鲜肉(鲑鱼)色 
522 #define YD_COLOR_TOMATO                 YD_RGB(255,  99,  71)        // 番茄红 
523 #define YD_COLOR_MISTY_ROSE             YD_RGB(255, 228, 225)        // 薄雾玫瑰 
524 #define YD_COLOR_SALMON                 YD_RGB(250, 128, 114)        // 鲜肉(鲑鱼)色 
525 #define YD_COLOR_SNOW                   YD_RGB(255, 250, 250)        //
526 #define YD_COLOR_LIGHT_CORAL            YD_RGB(240, 128, 128)        // 淡珊瑚色 
527 #define YD_COLOR_ROSY_BROWN             YD_RGB(188, 143, 143)        // 玫瑰棕色 
528 #define YD_COLOR_INDIAN_RED             YD_RGB(205,  92,  92)        // 印度红 
529 #define YD_COLOR_RED                    YD_RGB(255,   0,   0)        // 纯红 
530 #define YD_COLOR_BROWN                  YD_RGB(165,  42,  42)        // 棕色 
531 #define YD_COLOR_FIRE_BRICK             YD_RGB(178,  34,  34)        // 耐火砖 
532 #define YD_COLOR_DARK_RED               YD_RGB(139,   0,   0)        // 深红色 
533 #define YD_COLOR_MAROON                 YD_RGB(128,   0,   0)        // 栗色 
534 #define YD_COLOR_WHITE                  YD_RGB(255, 255, 255)        // 纯白 
535 #define YD_COLOR_WHITE_SMOKE            YD_RGB(245, 245, 245)        // 白烟 
536 #define YD_COLOR_GAINSBORO              YD_RGB(220, 220, 220)        // 庚斯博罗灰色 
537 #define YD_COLOR_LIGHT_GREY             YD_RGB(211, 211, 211)        // 浅灰色 
538 #define YD_COLOR_SILVER                 YD_RGB(192, 192, 192)        // 银灰色 
539 #define YD_COLOR_DARK_GRAY              YD_RGB(169, 169, 169)        // 深灰色 
540 #define YD_COLOR_GRAY                   YD_RGB(186, 183, 186)        // 灰色(*) 
541 #define YD_COLOR_DIM_GRAY               YD_RGB(105, 105, 105)        // 暗淡的灰色 
542 #define YD_COLOR_BLACK                  YD_RGB(  0,   0,   0)        // 纯黑 
543 
544 // --------------------------------------------------------------------------------------
545 
546 #endif

 

posted on 2013-12-02 16:29  叶飞影  阅读(1082)  评论(1编辑  收藏  举报