react-native-get-pixel-color
Description
Get HEX color value from image in React Native. Works both for iOS and Android.
Getting started
$ npm install react-native-get-pixel-color --save
or
$ yarn add react-native-get-pixel-color
Important note
For iOS you should pass the path to the file, however for Android you should pass base64 string of the image. In the near future both implementations would be unified to both use only one of these options.
Usage (iOS)
import GetPixelColor from 'react-native-get-pixel-color';
GetPixelColor.getHex(pathToFile, {
x: x,
y: y,
})
.then(hex => {
})
.catch(err => {
});
Usage (Android)
import GetPixelColor from 'react-native-get-pixel-color';
GetPixelColor.getHex(base64, {
x: x,
y: y,
})
.then(hex => {
})
.catch(err => {
});
Disclaimer
At this moment iOS implementation of this module is forked from https://github.com/crispipear/react-native-pixel-color.