You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-35Lines changed: 43 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,9 @@
1
1
# react-native-material-palette
2
2
3
3
[![Build Status][build-badge]][build]
4
-
[![Code Coverage][coverage-badge]][coverage]
5
4
[![Version][version-badge]][package]
6
5
[![MIT License][license-badge]][license]
7
-
8
-
[![PRs Welcome][prs-welcome-badge]][prs-welcome]
9
6
[![Chat][chat-badge]][chat]
10
-
[![Code of Conduct][coc-badge]][coc]
11
7
12
8
[Android Palette API](https://developer.android.com/training/material/palette-colors.html) brought to react native. It extracts prominent colors from images to help you create visually engaging apps.
13
9
@@ -69,14 +65,17 @@ Each `PaletteSwatch` has the following properties:
69
65
Specifies a rectangular area of the image to use for palette generation. Coordinates are in pixels.
70
66
71
67
```tsx
72
-
const palette =awaitcreatePalette(source, {
73
-
region: {
74
-
left: 0,
75
-
top: 0,
76
-
right: 100,
77
-
bottom: 100,
78
-
},
79
-
});
68
+
const palette =awaitcreatePalette(
69
+
{ uri: 'https://example.com/photo.jpg' },
70
+
{
71
+
region: {
72
+
left: 0,
73
+
top: 0,
74
+
right: 100,
75
+
bottom: 100,
76
+
},
77
+
}
78
+
);
80
79
```
81
80
82
81
##### `maximumColorCount`
@@ -90,18 +89,21 @@ Extract a single swatch using a custom target for fine-grained control over colo
0 commit comments