From 56d74063075c6df9dccc69a402c0375486d1f118 Mon Sep 17 00:00:00 2001 From: Liu Xinran Date: Tue, 6 Feb 2018 17:45:18 +0800 Subject: [PATCH] fix #109 --- src/mixin/color.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/mixin/color.js b/src/mixin/color.js index 8d4ca73..c29242c 100644 --- a/src/mixin/color.js +++ b/src/mixin/color.js @@ -24,18 +24,20 @@ function _colorChange (data, oldHue) { hsv.h = hsl.h = data.h || (data.hsl && data.hsl.h) || oldHue || 0 } + /* --- comment this block to fix #109, may cause #25 again --- */ // when the hsv.v is less than 0.0164 (base on test) // because of possible loss of precision // the result of hue and saturation would be miscalculated - if (hsv.v < 0.0164) { - hsv.h = data.h || (data.hsv && data.hsv.h) || 0 - hsv.s = data.s || (data.hsv && data.hsv.s) || 0 - } + // if (hsv.v < 0.0164) { + // hsv.h = data.h || (data.hsv && data.hsv.h) || 0 + // hsv.s = data.s || (data.hsv && data.hsv.s) || 0 + // } - if (hsl.l < 0.01) { - hsl.h = data.h || (data.hsl && data.hsl.h) || 0 - hsl.s = data.s || (data.hsl && data.hsl.s) || 0 - } + // if (hsl.l < 0.01) { + // hsl.h = data.h || (data.hsl && data.hsl.h) || 0 + // hsl.s = data.s || (data.hsl && data.hsl.s) || 0 + // } + /* ------ */ return { hsl: hsl,