18f8849dbfc9a984d0a9cb0299f58abe0127aed8
[supertux.git] / src / video / color.hpp
1 #ifndef __COLOR_HPP__
2 #define __COLOR_HPP__
3
4 #include <vector>
5
6 class Color
7 {
8 public:
9   Color()
10     : red(0), green(0), blue(0), alpha(1.0)
11   { }
12   Color(float red, float green, float blue, float alpha = 1.0)
13     : red(red), green(green), blue(blue), alpha(alpha)
14   { }
15   Color(const std::vector<float>& vals)
16   {
17     red = vals[0];
18     green = vals[1];
19     blue = vals[2];
20     if(vals.size() > 3)
21       alpha = vals[3];
22   }
23
24   float red, green, blue, alpha;
25 };
26
27 #endif
28