Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-get-pixel-color

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-get-pixel-color

React Native Get Pixel Color

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by250%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Pixel Color

Returns the pixel color from a graphic at a given coordinate.

Setup

Install the package:

React-Native 0.29.2+

npm install --save react-native-get-pixel-color
react-native link react-native-get-pixel-color

React-Native < 0.29.2

npm install rnpm -g
rnpm install react-native-get-pixel-color

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 PixelColor from 'react-native-get-pixel-color';

PixelColor.getHex(imageUriOrData, { x, y }).then((color) => {
  // #000000
}).catch((err) => {
  // Oops, something went wrong. Check that the filename is correct and
  // inspect err to get more details.
});

Sample app

Examples are found in the the examples folder.

API

promise getHex(path, options)

The promise resolves with a string containing the uri of the new file.

OptionDescription
pathPath of image file, or a base64 encoded image string prefixed with 'data:image/imagetype' where imagetype is jpeg or png.
options{ x: int, y: int }

Keywords

FAQs

Package last updated on 07 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc