React eye dropper
npm install react-eyedropper##Screenshots
sh
npm install --save react-eyedropper
`Usage
`js
import React, { Component } from 'react'
import EyeDropper from 'react-eyedropper'class App extends Component {
state = {
r: 255,
g: 255,
b: 255
}
setColor = ({ r, g, b }) => {
this.setState({ r, g, b })
}
render() {
const {r, g, b} = this.state
return (
rgb(106, 0, 0)
rgb(106, 124, 0)
rgb(106, 124, 138)
rgb(15, 124, 138)
rgb(15, 44, 138)
rgb(219, 238, 97)
gradient
rgb(${r}, ${g}, ${b})}}>rgb({r}, {g}, {b})

)
}
}
`API
$3
props | description
--- | ---
initializedColor | Type: function , required
callback, arg is object {r,g,b}
onInit | Type: function ,
pre condition
className | Type: string,
for style
title | Type: string`, https://github.com/bfred-it/get-canvas-pixel-color/
https://github.com/niklasvh/html2canvas