From 44aa2ce2fc29181d287750f874c7383cdd00022f Mon Sep 17 00:00:00 2001 From: cuiyuanyuan Date: Tue, 9 Nov 2021 16:26:55 +0800 Subject: [PATCH] fix with negative arguments serious problems --- tinycolor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinycolor.js b/tinycolor.js index 7534fc7..5f874df 100644 --- a/tinycolor.js +++ b/tinycolor.js @@ -664,7 +664,7 @@ function splitcomplement(color) { } function analogous(color, results, slices) { - results = results || 6; + results = results > 0 ? results: 6; slices = slices || 30; var hsl = tinycolor(color).toHsl(); @@ -679,7 +679,7 @@ function analogous(color, results, slices) { } function monochromatic(color, results) { - results = results || 6; + results = results > 0 ? results: 6; var hsv = tinycolor(color).toHsv(); var h = hsv.h, s = hsv.s, v = hsv.v; var ret = [];