From c044dd88b22ca081a7256fe663acf7e3ebf284d8 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(+) (limited to 'src/mbgl/style') 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