diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-09-11 13:21:14 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-09-13 15:55:34 -0700 |
commit | c044dd88b22ca081a7256fe663acf7e3ebf284d8 (patch) | |
tree | 643330548e426ea34f7e2ad531449485c710d926 | |
parent | df93047d405d17f86d54c6784e3664436085deb3 (diff) | |
download | qtlocation-mapboxgl-c044dd88b22ca081a7256fe663acf7e3ebf284d8.tar.gz |
[core] to-color should be idempotent
Ports https://github.com/mapbox/mapbox-gl-js/pull/7260.
-rw-r--r-- | src/mbgl/style/expression/coercion.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<Color> result = Color::parse(colorString); if (result) { |