Delayed root hatching
[supertux.git] / src / video / color.hpp
index dc912f7..e94b362 100644 (file)
@@ -21,6 +21,7 @@
 #define __COLOR_HPP__
 
 #include <vector>
+#include <assert.h>
 #include "log.hpp"
 
 class Color
@@ -38,6 +39,7 @@ public:
   }
   Color(const std::vector<float>& vals)
   {
+    assert(vals.size() >= 3);
     red = vals[0];
     green = vals[1];
     blue = vals[2];
@@ -50,6 +52,12 @@ public:
 #endif
   }
 
+  bool operator==(const Color& other) const
+  {
+    return red == other.red && green == other.green && blue == other.blue
+           && alpha == other.alpha;
+  }
+
   void check_color_ranges()
   {
     if(red < 0 || red > 1.0 || green < 0 || green > 1.0
@@ -62,4 +70,3 @@ public:
 };
 
 #endif
-