mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 05:44:24 +00:00
fixes #54
Signed-off-by: Mohamad Ahmadi <mohamadhasan.ahmadi@gmail.com>
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