mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 05:11:15 +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() {
|
||||
let color = Color("rgb(255,255,255)");
|
||||
|
||||
// Catch invalid color.
|
||||
try {
|
||||
return Color(this.props.value).rgb()
|
||||
}
|
||||
catch(err) {
|
||||
console.warn("Error parsing color: ", err);
|
||||
return Color("rgb(255,255,255)");
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Reference in a new issue