// FILE: color.h // written for the course 2172, 1999 // #if !defined(_COLOR_H_) #define _COLOR_H_ #include /* color: * * the color <-1,-1,-1> represents * "clear", "transparent" or "the eraser" * * <0,0,0> : black * <255,255,255> : white */ class color { protected: short _red,_green,_blue; // color components // according to rgb // scheme public: // color(r,g,b) // creates a color with specified comp color(short=0,short=0,short=0); short red() const; // red component short green() const; // green component short blue() const; // blue component // returns true if c1 == c2 friend bool operator==(const color&,const color&); // returns true if c1 != c2 friend bool operator!=(const color&,const color&); friend ostream& operator<<(ostream&, const color&); }; extern const color clear; // the color <-1,-1,-1> // some standard colors extern const color black; extern const color white; extern const color red; extern const color green; extern const color blue; extern const color yellow; extern const color magenta; extern const color cyan; #endif