From a7bccee6f5d2dbb14c62527f74f98d7b91492bb9 Mon Sep 17 00:00:00 2001 From: Zachary Wasserman Date: Tue, 23 Jul 2019 11:48:58 -0700 Subject: [PATCH] Fix bug in scale-color with positive saturation The ternary operator incorrectly selected the luminance value when it should have used the saturation. With this fix, the returned values are as expected per the issue. Fixes #2903. --- src/fn_colors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fn_colors.cpp b/src/fn_colors.cpp index 64ce38048c..e10b2eb575 100644 --- a/src/fn_colors.cpp +++ b/src/fn_colors.cpp @@ -504,7 +504,7 @@ namespace Sass { double lscale = (l ? DARG_R_PRCT("$lightness") : 0.0) / 100.0; double ascale = (a ? DARG_R_PRCT("$alpha") : 0.0) / 100.0; if (hscale) c->h(c->h() + hscale * (hscale > 0.0 ? 360.0 - c->h() : c->h())); - if (sscale) c->s(c->s() + sscale * (sscale > 0.0 ? 100.0 - c->l() : c->s())); + if (sscale) c->s(c->s() + sscale * (sscale > 0.0 ? 100.0 - c->s() : c->s())); if (lscale) c->l(c->l() + lscale * (lscale > 0.0 ? 100.0 - c->l() : c->l())); if (ascale) c->a(c->a() + ascale * (ascale > 0.0 ? 1.0 - c->a() : c->a())); return c.detach();