1.0.5 • Published 6 years ago

image-palette2 v1.0.5

Weekly downloads
11
License
-
Repository
github
Last release
6 years ago

Image-palette

API

var palette = require('image-palette2');
// image_path,color_number,callback
palette('./examples/cat.jpg', 5, function (colors) {
	console.log(colors);
});

Result:

[ { color: [ 132, 124, 70 ], ratio: 87.59066481265737 },
  { color: [ 195, 209, 180 ], ratio: 6.681114576939298 },
  { color: [ 179, 178, 175 ], ratio: 2.8457372401150822 },
  { color: [ 33, 30, 20 ], ratio: 2.348829343455222 },
  { color: [ 78, 48, 27 ], ratio: 0.5336540268330264 } ]

Installation

$ npm install image-palette2