diff --git a/src/color-thief.js b/src/color-thief.js index 50809b9..1bac747 100644 --- a/src/color-thief.js +++ b/src/color-thief.js @@ -98,7 +98,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' || quality < 1) {