00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HK_COLOUR_H
00012 #define HK_COLOUR_H
00013 #include "hk_class.h"
00014 #include <iostream>
00024 class hk_colour: public hk_class
00025 {
00026 friend istream& operator>>(istream&,hk_colour&);
00027 friend ostream& operator<<(ostream&,hk_colour&);
00028 public:
00029
00030 typedef int hk_colourtype ;
00031
00032 hk_colour(void);
00033 hk_colour(hk_colourtype red, hk_colourtype green, hk_colourtype blue);
00034 hk_colour(const hk_colour&);
00035 virtual ~hk_colour();
00040 bool set_colour(hk_colourtype red, hk_colourtype green, hk_colourtype blue);
00041 hk_colourtype red(void) const;
00042 hk_colourtype green(void) const;
00043 hk_colourtype blue(void) const;
00044 bool operator=(const hk_colour&);
00045 bool operator==(const hk_colour&);
00046 bool operator!=(const hk_colour&);
00047
00048 virtual void savedata(ostream& s );
00049 virtual void loaddata(const hk_string& definition);
00050
00051 protected:
00052
00053 private:
00054 void set_hk_colour( const hk_colour&);
00055 bool is_equal(const hk_colour&);
00056 hk_colourtype p_red;
00057 hk_colourtype p_green;
00058 hk_colourtype p_blue;
00059
00060 };
00061
00062 ostream& operator<<(ostream&,hk_colour&);
00063 ostream& operator<<(ostream&,const hk_colour&);
00064
00065 const hk_colour hk_aqua(0,255,255);
00066 const hk_colour hk_beige(0xF5,0xF5,0xDC);
00067 const hk_colour hk_black(0,0,0);
00068 const hk_colour hk_blue(0,0,255);
00069 const hk_colour hk_brown(0xA5,0x2A,0x2A);
00070 const hk_colour hk_fuchsia(255,0,255);
00071 const hk_colour hk_darkgrey(0xA9,0xA9,0xA9);
00072 const hk_colour hk_darkyellow(0xEE,0xCA,0x16);
00073 const hk_colour hk_green(0,128,0);
00074 const hk_colour hk_grey(128,128,128);
00075 const hk_colour hk_lightgrey(0xD3,0xD3,0xD3);
00076 const hk_colour hk_lime(0,255,0);
00077 const hk_colour hk_maroon(128,0,0);
00078 const hk_colour hk_navy(0,0,128);
00079 const hk_colour hk_olive(128,128,0);
00080 const hk_colour hk_orange(0xFF,0xA5,0);
00081 const hk_colour hk_pink(0xFF,0xC0,0xCB);
00082 const hk_colour hk_purple(128,0,128);
00083 const hk_colour hk_red(255,0,0);
00084 const hk_colour hk_silver(0,0xc0,0xc0);
00085 const hk_colour hk_teal(0,128,128);
00086 const hk_colour hk_white(255,255,255);
00087 const hk_colour hk_yellow(255,255,0);
00088 #endif //HK_COLOUR_H