Add operator overloads for Color taking Color references

This commit is contained in:
Eryn Wells 2013-09-13 18:23:25 -07:00
parent cae8b21068
commit dea1967344
2 changed files with 87 additions and 0 deletions

View file

@ -72,6 +72,16 @@ struct Color
Color &operator=(const Color &rhs);
// These operators blend the two colors.
Color &operator*=(const Color &rhs);
Color &operator/=(const Color &rhs);
Color &operator+=(const Color &rhs);
Color &operator-=(const Color &rhs);
Color operator*(const Color &rhs) const;
Color operator/(const Color &rhs) const;
Color operator+(const Color &rhs) const;
Color operator-(const Color &rhs) const;
static const Color Black;
static const Color White;
static const Color Red;
@ -81,4 +91,6 @@ struct Color
float red, green, blue, alpha;
};
const Color operator*(const float &lhs, const Color &rhs);
#endif