mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 22:04:25 +00:00
more readme updates
This commit is contained in:
@@ -11,14 +11,18 @@ A script for grabbing the dominant color or a representative color palette from
|
|||||||
|
|
||||||
###Usage
|
###Usage
|
||||||
|
|
||||||
####getDominantColor(sourceImage)
|
```js
|
||||||
|
getDominantColor(sourceImage)
|
||||||
returns {r: num, g: num, b: num}
|
returns {r: num, g: num, b: num}
|
||||||
|
```
|
||||||
|
|
||||||
Use the median cut algorithm provided by quantize.js to cluster similar
|
Use the median cut algorithm provided by quantize.js to cluster similar
|
||||||
colors and return the base color from the largest cluster.
|
colors and return the base color from the largest cluster.
|
||||||
|
|
||||||
####createPalette(sourceImage, colorCount)
|
```js
|
||||||
|
createPalette(sourceImage, colorCount)
|
||||||
returns array[ {r: num, g: num, b: num}, {r: num, g: num, b: num}, ...]
|
returns array[ {r: num, g: num, b: num}, {r: num, g: num, b: num}, ...]
|
||||||
|
```
|
||||||
|
|
||||||
Use the median cut algorithm provided by quantize.js to cluster similar
|
Use the median cut algorithm provided by quantize.js to cluster similar
|
||||||
colors.
|
colors.
|
||||||
|
|||||||
Reference in New Issue
Block a user