#ifndef COLORH #define COLORH #include //for ostream using namespace std; class color { int red; int green; int blue; public: color(): red(0), green(0), blue(0) {} //black by default color(int initial_red, int initial_green, int initial_blue); friend bool operator==(const color& color1, const color& color2); color& operator+=(const color& another); color& operator-=(const color& another); color& operator*=(double d); color& operator/=(double d); void print() const; friend ostream& operator<<(ostream& ost, const color& c); }; inline bool operator!=(const color& color1, const color& color2) { return !(color1 == color2); } inline const color operator+(color color1, const color& color2) { return color1 += color2; } inline const color operator-(color color1, const color& color2) { return color1 -= color2; } inline const color operator*(color c, double d) {return c *= d;} inline const color operator*(double d, color c) {return c *= d;} inline const color operator/(color c, double d) {return c /= d;} #endif