00001 #ifndef GUI_COLOR_HPP
00002 #define GUI_COLOR_HPP
00003
00004 #include <iosfwd>
00005
00006 namespace gui
00007 {
00009 class color
00010 {
00011 public :
00012
00013 typedef float chanel;
00014
00015 color();
00016 color(chanel nr, chanel ng, chanel nb, chanel na = 1.0f);
00017
00018 bool operator == (const color& c) const;
00019 bool operator != (const color& c) const;
00020
00021 void operator += (const color& c);
00022 void operator -= (const color& c);
00023 void operator *= (const color& c);
00024 void operator *= (float f);
00025
00026 chanel r, g, b, a;
00027
00028 static const color EMPTY;
00029 static const color WHITE;
00030 static const color BLACK;
00031 static const color RED;
00032 static const color GREEN;
00033 static const color BLUE;
00034 static const color GREY;
00035 };
00036
00037 color operator + (const color& c1, const color& c2);
00038 color operator - (const color& c1, const color& c2);
00039 color operator * (const color& c1, const color& c2);
00040 color operator * (const color& c1, float f);
00041 color operator * (float f, const color& c2);
00042
00043 std::ostream& operator << (std::ostream& mStream, const color& mColor);
00044 }
00045
00046 #endif