diff options
Diffstat (limited to 'include/mbgl/util/color.hpp')
-rw-r--r-- | include/mbgl/util/color.hpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/mbgl/util/color.hpp b/include/mbgl/util/color.hpp index d7fe61c640..82cd3c42e7 100644 --- a/include/mbgl/util/color.hpp +++ b/include/mbgl/util/color.hpp @@ -5,6 +5,20 @@ namespace mbgl { // Stores a premultiplied color, with all four channels ranging from 0..1 -using Color = std::array<float, 4>; +class Color { +public: + float r = 0.0f; + float g = 0.0f; + float b = 0.0f; + float a = 0.0f; +}; + +inline bool operator== (const Color& colorA, const Color& colorB) { + return colorA.r == colorB.r && colorA.g == colorB.g && colorA.b == colorB.b && colorA.a == colorB.a; +} + +inline bool operator!= (const Color& colorA, const Color& colorB) { + return !(colorA.r == colorB.r && colorA.g == colorB.g && colorA.b == colorB.b && colorA.a == colorB.a); +} } // namespace mbgl |