00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00023 #ifndef INCLUDE_3D_COLOR_H
00024 #define INCLUDE_3D_COLOR_H
00025 
00026 typedef struct 
00027 {
00028         float r;
00029         float g;
00030         float b;
00031         float a;
00032 } RGBA;
00033 
00040 class Color
00041 {
00042 public: 
00043         union
00044         {
00045                 float value[4];
00046                 struct 
00047                 {
00048                         float r;
00049                         float g;
00050                         float b;
00051                         float a;
00052                 };
00053         };
00054         BOOL isEnable;
00055 
00056 public:
00057         Color();
00058         Color(float r,float g,float b,float a);
00059         Color(float rgba);
00060         void Zero();
00061         void operator=(Color &source);
00062         void operator=(float *source);
00063 
00064         void SetNull();
00065         void SetFull();
00066         void Set(float _r,float _g,float _b);
00067         void Set(float _r,float _g,float _b,float _a);
00068         operator float *() const;
00069         void ToString (MyString &text);
00070 };
00071 
00072 #endif