Package Exports
- react-native-image-color-picker-fork
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-image-color-picker-fork) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-native-image-color-picker
Image color picker: Provide image source and it will return
- Different color palettes out of image
- Average color palette out of image
Getting started
$ npm install react-native-image-color-picker --save
or
$ yarn add react-native-image-color-picker --save
and
$ react-native link image-color-picker #(for android)
Usage
import React, { Component } from 'react';
import { ImageColorPicker } from 'react-native-image-color-picker';
export default class App extends Component {
pickerCallback = message => {
if (message && message.nativeEvent && message.nativeEvent.data) {
console.log(message.nativeEvent.data); // response from ImageColorPicker
}
};
render() {
return (
....
<ImageColorPicker
imageUrl="https://dummyimage.com/100x100"
pickerCallback={this.pickerCallback}
/>
....
);
}
}
Available Props/Options
imageUrl
: url of imagepickerCallback
: callback method for ImageColorPicker Success or Failure- (optional)
imageType
: type of image e.g. jpeg, pngDefault value: jpeg
- (optional)
paletteType
: palette type e.gaverage
: for average color of image,dominant
: dominant colors in imageDefault value: dominant
- (optional)
paletteCount
: no of color palettes need e.g. 3 dominant color palette, applicable only in case ofpaletteType: 'dominant'
Default value: 3
- (optional)
defaultPalette
: default color paletteDefault value: [0, 0, 0, 1]
- (optional)
colorType
: color code type e.g. rgba or hexDefault value: rgba
- (optional)
pickerStyle
: picker container styles - (optional)
imageWidth
: custom image width, other than natural - (optional)
imageHeight
: custom image height, other than natural
Example App
TODO
- Support Image picker gallery
Contributing
Interested in contributing to this repository? PR are most welcome!