diff options
Diffstat (limited to 'src/mbgl/util/interpolate.hpp')
-rw-r--r-- | src/mbgl/util/interpolate.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mbgl/util/interpolate.hpp b/src/mbgl/util/interpolate.hpp index 18a9e6bbc5..8b9929fa4a 100644 --- a/src/mbgl/util/interpolate.hpp +++ b/src/mbgl/util/interpolate.hpp @@ -5,6 +5,7 @@ #include <string> #include <type_traits> #include <utility> +#include <mbgl/util/color.hpp> namespace mbgl { namespace util { @@ -41,6 +42,19 @@ public: } }; +template <> +struct Interpolator<Color> { +public: + Color operator()(const Color& a, const Color& b, const double t) { + return { + interpolate(a.r, b.r, t), + interpolate(a.g, b.g, t), + interpolate(a.b, b.b, t), + interpolate(a.a, b.a, t) + }; + } +}; + struct Uninterpolated { template <class T> T operator()(const T&, const T& b, const double) const { |