1.0.0 • Published 6 years ago
react-native-extract-color v1.0.0
react-native-extract-color
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
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-extract-color
and addRNExtractColor.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNExtractColor.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)
License
Copyright © 2018, zzetao. Released under the MIT License.
1.0.0
6 years ago