From d9017137e62662840d03c3aaa119d630b621d871 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 11 Sep 2018 13:21:14 -0700 Subject: [PATCH] [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 486658dddaf..2481444dc4c 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) {