diff --git a/src/color-thief.js b/src/color-thief.js index 615ac29..d93b2e3 100644 --- a/src/color-thief.js +++ b/src/color-thief.js @@ -64,7 +64,7 @@ var ColorThief = function () {}; * Use the median cut algorithm provided by quantize.js to cluster similar * colors and return the base color from the largest cluster. * - * Quality is an optional argument. It needs to be an integer. 0 is the highest quality settings. + * Quality is an optional argument. It needs to be an integer. 1 is the highest quality settings. * 10 is the default. There is a trade-off between quality and speed. The bigger the number, the * faster a color will be returned but the greater the likelihood that it will not be the visually * most dominant color. @@ -88,7 +88,7 @@ ColorThief.prototype.getColor = function(sourceImage, quality) { * * BUGGY: Function does not always return the requested amount of colors. It can be +/- 2. * - * quality is an optional argument. It needs to be an integer. 0 is the highest quality settings. + * quality is an optional argument. It needs to be an integer. 1 is the highest quality settings. * 10 is the default. There is a trade-off between quality and speed. The bigger the number, the * faster the palette generation but the greater the likelihood that colors will be missed. * @@ -99,7 +99,7 @@ ColorThief.prototype.getPalette = function(sourceImage, colorCount, quality) { if (typeof colorCount === 'undefined') { colorCount = 10; } - if (typeof quality === 'undefined') { + if (typeof quality === 'undefined' || quality < 1) { quality = 10; }