Merge pull request #55 from mhahmadi/mhahmadi_fix_mmcq_return_value

fixes #54
This commit is contained in:
Lokesh Dhakar
2015-06-29 17:12:24 -07:00

View File

@@ -128,7 +128,7 @@ ColorThief.prototype.getPalette = function(sourceImage, colorCount, quality) {
// Send array to quantize function which clusters values
// using median cut algorithm
var cmap = MMCQ.quantize(pixelArray, colorCount);
var palette = cmap.palette();
var palette = cmap? cmap.palette() : null;
// Clean up
image.removeCanvas();