diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2017-01-19 16:20:13 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2017-01-19 16:20:13 -0500 |
commit | 59edd60ebec61bf24dd27063f85bcd049fd0af13 (patch) | |
tree | 902bb77c940134d20e35dfcb556b8e755bc373ef /include/color.hpp | |
parent | 36ed75a7749b81fab69f66b9ef8bbf0d18489f73 (diff) |
killed common, more inventory, other random stuff
Diffstat (limited to 'include/color.hpp')
-rw-r--r-- | include/color.hpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/color.hpp b/include/color.hpp new file mode 100644 index 0000000..2c89a1c --- /dev/null +++ b/include/color.hpp @@ -0,0 +1,26 @@ +#ifndef COLOR_HPP_ +#define COLOR_HPP_ + +/** + * Keeps track of an RGBA color. + */ +class Color{ +public: + float red; /**< The amount of red, 0-255 or 0.0-1.0 depending on usage */ + float green; /**< The amount of green */ + float blue; /**< The amount of blue */ + float alpha; /**< Transparency */ + + Color(float r = 0, float g = 0, float b = 0, float a = 255) + : red(r), green(g), blue(b), alpha(a) {} + + Color operator-(const float& a) { + return Color(red - a, green - a, blue - a, alpha); + } + + Color operator+(const float& a) { + return Color(red + a, green + a, blue + a, alpha); + } +}; + +#endif // COLOR_HPP_ |