https://github.com/jerson/react-native-palette-full
info about colors from images or url, compatible with **Android** and **iOS**
https://github.com/jerson/react-native-palette-full
android colors ios palette react-native
Last synced: 5 months ago
JSON representation
info about colors from images or url, compatible with **Android** and **iOS**
- Host: GitHub
- URL: https://github.com/jerson/react-native-palette-full
- Owner: jerson
- License: mit
- Created: 2018-06-16T19:58:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-17T15:12:11.000Z (over 5 years ago)
- Last Synced: 2025-05-20T16:56:32.983Z (about 1 year ago)
- Topics: android, colors, ios, palette, react-native
- Language: Objective-C
- Homepage: https://www.npmjs.com/package/react-native-palette-full
- Size: 56.6 KB
- Stars: 20
- Watchers: 3
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-palette-full
info about colors from images or url, compatible with **Android** and **iOS**
## Getting started
`$ npm install react-native-palette-full --save`
## Mostly automatic installation
`$ react-native link react-native-palette-full`
## Manual installation
### iOS
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-palette-full` and add `RNPalette.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNPalette.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Go to `Podfile` and add `"SDWebImage", "~>4.3.3"`
5. Run your project (`Cmd+R`)<
### Android
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
- Add `import me.jerson.mobile.palette.RNPalettePackage;` to the imports at the top of the file
- Add `new RNPalettePackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
```groovy
include ':react-native-palette-full'
project(':react-native-palette-full').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-palette-full/android')
```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```groovy
implementation project(':react-native-palette-full')
```
## Usage
```javascript
import Palette from "react-native-palette-full";
const outputColors = (colors)=>{
console.log(colors);
};
Palette.getNamedSwatchesFromUrl(url).then(outputColors);
Palette.getAllSwatchesFromUrl(url).then(outputColors);
Palette.getNamedSwatches(path).then(outputColors);
Palette.getAllSwatches(path).then(outputColors);
```