1.0.4 • Published 2 years ago

react-image-main-color v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-image-main-color

Will create a button or drop area to upload a JPG or PNG image and then will return a Hex Color value

NPM React Version JavaScript Style Guide

Install

npm install --save react-image-main-color

Usage

Button Example

import React, { useState } from 'react'
import { FileButtonInput  } from 'react-image-main-color'


class Example extends Component {
    const [colorData, setColorData] = useState('')

  render() {
    return <FileButtonInput
            button={<button>Upload File</button>}
            setColorData={setColorData}
          />
  }
}

Drop example

import React, { useState } from 'react'
import { FileAreaInput  } from 'react-image-main-color'


class Example extends Component {
    const [colorData, setColorData] = useState('')

  render() {
    return <FileAreaInput
            container={
              <div style={dropAreaStyle}>
                <h1>Drop File Here</h1>
              </div>
            }
            setColorData={setColorData}
          />
  }
}

License

MIT © danielth-uk

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago