react-native-extract-color

1.0.0 • Public • Published

# react-native-extract-color npm

Extract colors from an image

Usage

import ExtractColor from 'react-native-extract-color';
 
try {
  const colors = await ExtractColor.extract('/Users/zzetao/xx/../xx/LocalImagePath.png');
  /*
    colors:
    {
      primaryColor: '#hex',
      backgroundColor: '#hex',
      secondaryColor: '#hex',
      detailColor: '#hex'
    }
  */
} catch(e) {
  console.warn('error: ', e);
}

Getting started

$ yarn add react-native-extract-color

Mostly automatic installation

$ react-native link react-native-extract-color

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-extract-color and add RNExtractColor.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNExtractColor.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)

License

Copyright © 2018, zzetao. Released under the MIT License.

Dependents (1)

Package Sidebar

Install

npm i react-native-extract-color

Weekly Downloads

5

Version

1.0.0

License

MIT

Unpacked Size

1.28 MB

Total Files

13

Last publish

Collaborators

  • zzetao