Skip to content

Commit

Permalink
Fixes issue lokesh#32
Browse files Browse the repository at this point in the history
  • Loading branch information
nteike committed May 19, 2014
1 parent d515f4c commit fb25683
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/color-thief.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
*
Expand All @@ -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;
}

Expand Down

0 comments on commit fb25683

Please sign in to comment.