From 0c0064c050396eae8dad92e5097692537405704a Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 19 Dec 2016 17:10:51 -0800 Subject: [core] Get rid of user-specified refs --- src/mbgl/util/color.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mbgl/util/color.cpp') diff --git a/src/mbgl/util/color.cpp b/src/mbgl/util/color.cpp index eea897d3ab..d5751b405f 100644 --- a/src/mbgl/util/color.cpp +++ b/src/mbgl/util/color.cpp @@ -1,4 +1,5 @@ #include +#include #include @@ -17,4 +18,12 @@ optional Color::parse(const std::string& s) { }}; } +std::string Color::stringify() const { + return "rgba(" + + util::toString(r * 255) + "," + + util::toString(g * 255) + "," + + util::toString(b * 255) + "," + + util::toString(a) + ")"; +} + } // namespace mbgl -- cgit v1.2.1