* Fixed gradient background bug
[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     else
23       alpha = 1.0;
24   }
25
26   float red, green, blue, alpha;
27 };
28
29 #endif
30