Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

react-eyedropper

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-eyedropper

React eye dropper

latest
Source
npmnpm
Version
0.0.10
Version published
Maintainers
1
Created
Source

react-eyedropper

##Screenshots

Install

npm install --save react-eyedropper

Usage

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 (
      <div>
        <div className="main">
          <div className="container first">rgb(106, 0, 0)</div>
          <div className="container second">rgb(106, 124, 0)</div>
          <div className="container third">rgb(106, 124, 138)</div>
          <div className="container fourth">rgb(15, 124, 138)</div>
          <div className="container fifth">rgb(15, 44, 138)</div>
          <div className="container sixth">rgb(219, 238, 97)</div>
          <div className="container seventch">gradient</div>
        </div>
          <div className="result">
            <div className="container " style={{backgroundColor: `rgb(${r}, ${g}, ${b})`}}>rgb({r}, {g}, {b})</div>
          </div>
        <div className="eye-drop-container">
          <EyeDropper initializedColor={this.setColor}/>
        </div>
        <div id="container">
		      <img src="./test.jpg" id="sample"/>
	      </div>
      </div>
    )
  }
}


API

<EyeDropper initializedColor={this.setColor}/>

propsdescription
initializedColorType: function , required
callback, arg is object {r,g,b}
onInitType: function ,
pre condition
classNameType: string,
for style
titleType: string,
title

Dependencies

https://github.com/bfred-it/get-canvas-pixel-color/
https://github.com/niklasvh/html2canvas

License

ISC

Keywords

react

FAQs

Package last updated on 08 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts