//	Color.h#ifndef COLOR_H#define COLOR_H#define RGBsafe(i) ((i>0)*(i<maxValue ? i:maxValue))class RGB {public:	RGB() : R(0), G(0), B(0) {}	RGB( const int pR, const int pG, const int pB )			: R(RGBsafe(pR)), G(RGBsafe(pG)), B(RGBsafe(pB)) {}	// define arithmatic operators, etc. -- later!		int R,G,B;	static int maxValue;};class Palette {public:	Palette() : itsSize(16), itsRGB(new RGB[16]) {}	Palette( const int pSize ) : itsSize(pSize), itsRGB(new RGB[pSize]) {}	Palette( const Palette& pPal ) : itsRGB(0) { *this = pPal; }	~Palette() { if (itsRGB) delete itsRGB; }	Palette& operator= (const Palette& pPal);	RGB& operator() (const int pIndex)	{ return itsRGB[pIndex>0 && pIndex<itsSize? pIndex : 0]; }		int itsSize;	RGB *itsRGB;};// some standard colors#define kClrRed			RGB(RGB::maxValue, 0, 0)#define kClrGreen		RGB(0, RGB::maxValue, 0)#define kClrBlue		RGB(0, 0, RGB::maxValue)#define kClrYellow		RGB(RGB::maxValue, RGB::maxValue, 0)#define kClrPurple		RGB(RGB::maxValue, 0, RGB::maxValue)#define kClrTurquoise	RGB(0, RGB::maxValue, RGB::maxValue)#define kClrOrange		RGB(RGB::maxValue, RGB::maxValue/2, 0)#define kClrBlack		RGB(0, 0, 0)#define kClrWhite		RGB(RGB::maxValue, RGB::maxValue, RGB::maxValue)#define kClrGrey		RGB(RGB::maxValue/2, RGB::maxValue/2, RGB::maxValue/2)#endif
