Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/potapovdim/react-eyedropper
Simple react component for get color from image or html colored element
https://github.com/potapovdim/react-eyedropper
color-from eye-dropper react react-colorpicker
Last synced: 27 days ago
JSON representation
Simple react component for get color from image or html colored element
- Host: GitHub
- URL: https://github.com/potapovdim/react-eyedropper
- Owner: potapovDim
- Created: 2017-03-11T11:22:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T08:57:00.000Z (over 5 years ago)
- Last Synced: 2024-09-17T18:34:15.848Z (about 2 months ago)
- Topics: color-from, eye-dropper, react, react-colorpicker
- Language: JavaScript
- Homepage:
- Size: 1.02 MB
- Stars: 12
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-eyedropper
##Screenshots
## Install
```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})
)
}
}```
## API
### ``
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`,
title## Dependencies
https://github.com/bfred-it/get-canvas-pixel-color/
https://github.com/niklasvh/html2canvas## License
ISC