import React from 'react' import inputStyle from './input.js' import { getColor } from 'react-colorpickr/dist/colorfunc' import ChromePicker from '../chromepicker.jsx' function formatColor(color) { const rgb = color.rgb return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${rgb.a})` } /*** Number fields with support for min, max and units and documentation*/ class ColorField extends React.Component { static propTypes = { onChange: React.PropTypes.func.isRequired, name: React.PropTypes.string.isRequired, value: React.PropTypes.string, default: React.PropTypes.number, doc: React.PropTypes.string, } render() { return
this.props.onChange(formatColor(c))} />
this.props.onChange(e.target.value)} />
} } export default ColorField