// Variations of RGBA
typedef RGBA<int> iRGBA;
typedef RGBA<float> fRGBA;
typedef RGBA<double> dRGBA;
typedef RGBA<unsigned char> bRGBA;
////////////////////////
// Predefined Colors
////////////////////////
extern opengl_const fRGBA fwhite,fgray75,fgray50,fgray25,fblack;
///////////////////////////////////////////////////////////////////////////////
// RGBA
// - RGBA color structure stores and manipulates Red, Green, Blue, Alpha colors
// - scalarT is the scalar type for color components (double, float, byte...)
///////////////////////////////////////////////////////////////////////////////
template <class scalarT>
class RGBA
{
private:
typedef RGBA<scalarT> self; // Shortcut type to simplify declarations
public:
scalarT r,g,b,a; // Red, Green, Blue, Alpha values
// Constructors
inline RGBA() ; // Notice there is no "default" value of zero
inline RGBA(scalarT _r, scalarT _g, scalarT _b, scalarT _a=1)
inline RGBA(const self &c)
// This is a shortcut for assignment that "looks" like a constructor
inline void operator ()(scalarT _r, scalarT _g, scalarT _b, scalarT _a=1)
// Operator for converting to openGL an array of scalarT values (scalarT[])
inline operator const scalarT *() const
inline operator scalarT *()
// Mathematical operators
inline self operator + (const self &rhs) const
inline self operator - (const self &rhs) const
inline self operator / (scalarT scale) const
inline self operator * (scalarT scale) const
inline bool operator ==(const fRGBA &rhs) const
inline bool operator !=(const fRGBA &rhs) const
inline self operator -=(const self &rhs)
inline self operator +=(const self &rhs)
inline self operator /=(scalarT scale)
inline self operator *=(scalarT scale)
};