| | |
| | | handleChange = (color) => { |
| | | let _color = `rgba(${ color.rgb.r }, ${ color.rgb.g }, ${ color.rgb.b }, ${ color.rgb.a })` |
| | | |
| | | this.setState({ color: _color }, () => { |
| | | this.props.onChange(_color) |
| | | }) |
| | | if (!this.props.config.isHex) { |
| | | this.setState({ color: _color }, () => { |
| | | this.props.onChange(_color) |
| | | }) |
| | | } else { |
| | | let _hex = color.hex === 'transparent' ? '#ffffff' : color.hex |
| | | |
| | | this.setState({ color: _hex }, () => { |
| | | this.props.onChange(_hex) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | |
| | | |
| | | render() { |
| | | const { color } = this.state |
| | | |
| | | return ( |
| | | <div className="color-sketch-block"> |
| | | <Popover content={ |