mirror of
https://github.com/maputnik/editor.git
synced 2026-11-28 04:44:20 +00:00
Tidy logic.
This commit is contained in:
1 parent
b20c69b15a
commit
a50b09e5a2
1 file changed
+1
-3
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user