1.0.0 • Published 6 years ago

react-native-extract-color v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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.