00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef COLOR_H
00019 #define COLOR_H
00020
00021
00026 class Color {
00027 public:
00029 Color( float r=1, float g=1, float b=1, float a=1 );
00031 Color( float *color );
00033 ~Color();
00034
00036 void set( float r=-1, float g=-1, float b=-1, float a=-1 );
00038 void set( float *color );
00040 const float* RGBA() { return rgba; }
00041
00043 float r() { return rgba[0]; }
00045 float g() { return rgba[1]; }
00047 float b() { return rgba[2]; }
00049 float a() { return rgba[3]; }
00050
00052 Color operator*(const Color &c);
00054 Color operator+(const Color &c);
00056 Color operator-(const Color &c);
00058 Color operator=(const Color& c);
00059
00060 private:
00062 void clamp();
00063 float rgba[4];
00064 };
00065
00066 #endif