From aff2b1483f83a4426206d5df97c705882f294bb2 Mon Sep 17 00:00:00 2001 From: Mohamad Ahmadi Date: Sun, 15 Feb 2015 12:29:24 -0500 Subject: [PATCH] fixes #56 Signed-off-by: Mohamad Ahmadi --- src/color-thief.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/color-thief.js b/src/color-thief.js index 615ac29..14530b3 100644 --- a/src/color-thief.js +++ b/src/color-thief.js @@ -96,7 +96,7 @@ ColorThief.prototype.getColor = function(sourceImage, quality) { */ ColorThief.prototype.getPalette = function(sourceImage, colorCount, quality) { - if (typeof colorCount === 'undefined') { + if (typeof colorCount === 'undefined' || colorCount < 2 || colorCount > 256) { colorCount = 10; } if (typeof quality === 'undefined') {