mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 22:04:25 +00:00
fixes #56
Signed-off-by: Mohamad Ahmadi <mohamadhasan.ahmadi@gmail.com>
This commit is contained in:
@@ -96,7 +96,7 @@ ColorThief.prototype.getColor = function(sourceImage, quality) {
|
|||||||
*/
|
*/
|
||||||
ColorThief.prototype.getPalette = function(sourceImage, colorCount, quality) {
|
ColorThief.prototype.getPalette = function(sourceImage, colorCount, quality) {
|
||||||
|
|
||||||
if (typeof colorCount === 'undefined') {
|
if (typeof colorCount === 'undefined' || colorCount < 2 || colorCount > 256) {
|
||||||
colorCount = 10;
|
colorCount = 10;
|
||||||
}
|
}
|
||||||
if (typeof quality === 'undefined') {
|
if (typeof quality === 'undefined') {
|
||||||
|
|||||||
Reference in New Issue
Block a user