Image color picker based on image source provided and return image different color palettes or average color palette
npm install react-native-image-color-picker``sh`
$ npm install react-native-image-color-picker --save
or
`sh`
$ yarn add react-native-image-color-picker --save
`jsx
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 (
....
pickerCallback={this.pickerCallback}
/>
....
);
}
}
`
- imageUrl: url of image pickerCallback
- : callback method for ImageColorPicker Success or FailureimageType
- (optional): type of image e.g. jpeg, png Default value: jpegpaletteType
- (optional): palette type e.g average: for average color of image, dominant: dominant colors in image Default value: dominantpaletteCount
- (optional): no of color palettes need e.g. 3 dominant color palette, applicable only in case of paletteType: 'dominant' Default value: 3defaultPalette
- (optional): default color palette Default value: [0, 0, 0, 1]colorType
- (optional): color code type e.g. rgba or hex Default value: rgbapickerStyle
- (optional): picker container stylesimageWidth
- (optional): custom image width, other than naturalimageHeight`: custom image height, other than natural
- (optional)
- Support Image picker gallery
Interested in contributing to this repository? PR are most welcome!