From c3dfb141ba1bea8fdf47e1f3522853161cd7ade9 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 11 Sep 2018 13:21:14 -0700 Subject: [core] to-color should be idempotent Ports https://github.com/mapbox/mapbox-gl-js/pull/7260. --- src/mbgl/style/expression/coercion.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mbgl/style/expression/coercion.cpp b/src/mbgl/style/expression/coercion.cpp index 486658ddda..2481444dc4 100644 --- a/src/mbgl/style/expression/coercion.cpp +++ b/src/mbgl/style/expression/coercion.cpp @@ -30,6 +30,9 @@ EvaluationResult toNumber(const Value& v) { EvaluationResult toColor(const Value& colorValue) { return colorValue.match( + [&](const Color& color) -> EvaluationResult { + return color; + }, [&](const std::string& colorString) -> EvaluationResult { const optional result = Color::parse(colorString); if (result) { -- cgit v1.2.1