mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 13:54:25 +00:00
Merge pull request #55 from mhahmadi/mhahmadi_fix_mmcq_return_value
fixes #54
This commit is contained in:
@@ -128,7 +128,7 @@ ColorThief.prototype.getPalette = function(sourceImage, colorCount, quality) {
|
|||||||
// Send array to quantize function which clusters values
|
// Send array to quantize function which clusters values
|
||||||
// using median cut algorithm
|
// using median cut algorithm
|
||||||
var cmap = MMCQ.quantize(pixelArray, colorCount);
|
var cmap = MMCQ.quantize(pixelArray, colorCount);
|
||||||
var palette = cmap.palette();
|
var palette = cmap? cmap.palette() : null;
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
image.removeCanvas();
|
image.removeCanvas();
|
||||||
|
|||||||
Reference in New Issue
Block a user