mirror of
https://github.com/maputnik/editor.git
synced 2026-08-02 11:17:26 +00:00
Tidy logic.
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user