From 8990cd5b99df64245170afe6b1613174676946a2 Mon Sep 17 00:00:00 2001 From: Aleksandr Drozd Date: Mon, 3 Sep 2018 07:00:50 +0900 Subject: [PATCH] make saturation change multiplicative --- contextfree/contextfree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contextfree/contextfree.py b/contextfree/contextfree.py index ab64454..ff828bb 100644 --- a/contextfree/contextfree.py +++ b/contextfree/contextfree.py @@ -122,7 +122,7 @@ def __enter__(self): hue, lightness, saturation = colorsys.rgb_to_hls(r / 255, g / 255, b / 255) hue = math.modf(hue + self.hue)[0] lightness = math.modf(lightness * self.lightness)[0] - saturation = math.modf(saturation + self.saturation)[0] + saturation = math.modf(saturation * self.saturation)[0] r, g, b = colorsys.hls_to_rgb(hue, lightness, saturation) a = min((a * self.alpha), 255) rgba = [r * 255, g * 255, b * 255, a]