import React from 'react' import enhanceWithClickOutside from 'react-click-outside' import { SketchPicker } from 'react-color' import WindowPointer from './WindowPointer' import { COLORS } from '../lib/constants' import { parseRGBA } from '../lib/util' class ColorPicker extends React.Component { constructor() { super() this.state = { isVisible: false } this.toggle = this.toggle.bind(this) this.handlePickColor = this.handlePickColor.bind(this) } toggle() { this.setState({ isVisible: !this.state.isVisible }) } handleClickOutside() { this.setState({ isVisible: false }) } handlePickColor(color) { this.props.onChange(parseRGBA(color.rgb)) } render() { return (