Tidy logic.

This commit is contained in:
orangemug 2017-11-29 18:07:03 +00:00
parent b20c69b15a
commit a50b09e5a2

View file

@ -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() {