Go to file
2025-07-09 14:19:42 +09:00
android classifier 2025-07-09 14:19:42 +09:00
ios init 2025-07-09 11:41:52 +09:00
node_modules init 2025-07-09 11:41:52 +09:00
index.js init 2025-07-09 11:41:52 +09:00
LICENSE init 2025-07-09 11:41:52 +09:00
package-lock.json init 2025-07-09 11:41:52 +09:00
package.json test 2025-07-09 13:38:44 +09:00
README.md init 2025-07-09 11:41:52 +09:00

React Native Get Pixel

Returns the pixel color from an image at a given coordinate. Heavily inspired by https://github.com/spacesuitdiver/react-native-pixel-color

Setup

yarn add react-native-get-pixel
react-native link react-native-get-pixel

Android

Note: on latest versions of React Native, you may have an error during the Gradle build on Android (com.android.dex.DexException: Multiple dex files define Landroid/support/v7/appcompat/R$anim). Run cd android && ./gradlew clean to fix this.

Usage example

import { getPixelRGBA } from 'react-native-get-pixel';

getPixelRGBA('sample.png', x, y)
   .then(color => console.log(color)) // [243, 123, 0]
   .catch(err => {});

NOTE: You have to add sample.png to the Xcode project as a resource and to src/main/assets/drawable on Android.