diff options
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_ |