Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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