00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GV_COLOR_H
00018 #define GV_COLOR_H
00019
00020
00021
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00026 typedef struct hsvrgbacolor_t {
00027 char *name;
00028 unsigned char h, s, v;
00029 unsigned char r, g, b, a;
00030 } hsvrgbacolor_t;
00031
00032
00033 typedef enum { HSVA_DOUBLE, RGBA_BYTE, RGBA_WORD, CMYK_BYTE,
00034 RGBA_DOUBLE, COLOR_STRING, COLOR_INDEX } color_type_t;
00035
00036
00037 typedef struct color_s {
00038 union {
00039 double RGBA[4];
00040 double HSVA[4];
00041 unsigned char rgba[4];
00042 unsigned char cmyk[4];
00043 int rrggbbaa[4];
00044 char *string;
00045 int index;
00046 } u;
00047 color_type_t type;
00048 } gvcolor_t;
00049
00050 #define COLOR_MALLOC_FAIL -1
00051 #define COLOR_UNKNOWN 1
00052 #define COLOR_OK 0
00053
00054 #ifdef __cplusplus
00055 }
00056 #endif
00057 #endif