[core] to-color should be idempotent
Ports https://github.com/mapbox/mapbox-gl-js/pull/7260.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user