mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 20:31:17 +01:00
Tidy logic.
This commit is contained in:
parent
b20c69b15a
commit
a50b09e5a2
1 changed files with 1 additions and 3 deletions
|
@ -50,16 +50,14 @@ class ColorField extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
get color() {
|
get color() {
|
||||||
let color = Color("rgb(255,255,255)");
|
|
||||||
|
|
||||||
// Catch invalid color.
|
// Catch invalid color.
|
||||||
try {
|
try {
|
||||||
return Color(this.props.value).rgb()
|
return Color(this.props.value).rgb()
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
console.warn("Error parsing color: ", err);
|
console.warn("Error parsing color: ", err);
|
||||||
|
return Color("rgb(255,255,255)");
|
||||||
}
|
}
|
||||||
return color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in a new issue