A tiny Color Picker for React [ Demo ]
$ npm i --save coloreact
import ColorPicker from 'coloreact';
// ...
return (
<ColorPicker
opacity={true}
color={this.state.currentColor}
onChange={this.showColorNow}
onComplete={this.showLastColor} />
);
// ...
It is possible to create your own ColorPicker using Map
and Slider
s.
import { Map, Slider } from 'coloreact';
// ...
return (
<div className="myColorPicker">
<Map
x={this.state.saturation}
y={this.state.value}
max={100}
backgroundColor={this.getHue()}
onChange={this.handleSaturationValue}
/>
<Slider
vertical={true}
value={this.state.hue}
max={360}
onChange={this.handleHue}
/>
</div>
// ...
$ npm start
# goto http://localhost:3040/
The project start as a derivate of the awesome react-simple-colorpicker which is based on react-colorpicker. Licensed MIT.
coming soon