colorchart

0.0.2 • Public • Published

colorchart

Get most used colors in an image (in the browser). Compatible with browserify.

Demo page

Based on https://github.com/lokesh/color-thief but commonjs compatible and using the quantize module from npm.

npm install colorchart

Use

Get color palette

var colormap = require('colorchart')();

// arg 1 = dom image node to parse
// arg 2 = amount of colors get back
// arg 3 = quality level/accuracy to use in algorithm (default = 10)

var palette = colorchart.get(document.querySelector('img'), 5);

Get dominant color

var colorchart = require('colorchart')();
var palette = colorchart.getDominant(document.querySelector('img'));

Go to /example folder and run npm run example-js & npm start for a working example.

License

MIT licensed

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    24
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    24
  • 0.0.1
    3

Package Sidebar

Install

npm i colorchart

Weekly Downloads

3

Version

0.0.2

License

MIT

Last publish

Collaborators

  • anthonyringoet