How to use the react-color/lib/helpers/color.toState function in react-color

To help you get started, we’ve selected a few react-color examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eGust / epub-reader / src / js / renderer / components / colorPicker.jsx View on Github external
onChanged(color) {
		const { onChange } = this.props
			, newColor = Color.toState(color, 0)
		if (newColor.hex === this.state.color.hex)
			return
		this.setState({color: newColor})
		onChange && onChange(newColor)
	}
github LearningLocker / learninglocker / ui / src / components / ColorPicker / CustomColorPicker.js View on Github external
constructor(props) {
    super(props);
    this.state = {
      color: colorHelper.toState(props.initialColor || '#2BD867')
    };
  }
github eGust / epub-reader / src / js / renderer / components / colorPicker.jsx View on Github external
constructor(props) {
		super(props)
		this.state = {
			activePanel: 'material',
			color: Color.toState(props.color || '#88F', 0),
		}
	}
github eGust / epub-reader / src / js / renderer / components / colorPicker.jsx View on Github external
componentWillReceiveProps(nextProps) {
		if (nextProps.color) {
			this.setState({color: Color.toState(nextProps.color, 0)})
		}
	}