Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jerson committed Jun 6, 2019
1 parent 9dab149 commit 0ed3b92
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@

# react-native-palette-full

info about colors from images or url, compatible with **Android** and **iOS**

## Versions

- 1.0.9 (not started yet) we need support both, help please
- 1.0.8 typescript support
- 1.0.7 javascript support

## Getting started

`$ npm install react-native-palette-full --save`
Expand All @@ -13,38 +18,38 @@ info about colors from images or url, compatible with **Android** and **iOS**

### 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"`
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

- 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`:
```
include ':react-native-palette-full'
project(':react-native-palette-full').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-palette-full/android')
```
```
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`:
```
compile project(':react-native-palette-full')
```

```
compile project(':react-native-palette-full')
```

## Usage

```javascript
import Palette from 'react-native-palette-full';
import Palette from "react-native-palette-full";

Palette.getNamedSwatchesFromUrl(url);
Palette.getAllSwatchesFromUrl(url);
Palette.getNamedSwatches(path);
Palette.getAllSwatches(path);
Palette.getNamedSwatchesFromUrl(url);
Palette.getAllSwatchesFromUrl(url);
Palette.getNamedSwatches(path);
Palette.getAllSwatches(path);
```

4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


0 comments on commit 0ed3b92

Please sign in to comment.