Add operator overloads for Color taking Color references
This commit is contained in:
parent
cae8b21068
commit
dea1967344
2 changed files with 87 additions and 0 deletions
12
src/basics.h
12
src/basics.h
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue