Skip to content

Commit e913264

Browse files
zwassxzyfer
authored andcommitted
Fix bug in scale-color with positive saturation (#2954)
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.
1 parent 58d1066 commit e913264

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fn_colors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ namespace Sass {
504504
double lscale = (l ? DARG_R_PRCT("$lightness") : 0.0) / 100.0;
505505
double ascale = (a ? DARG_R_PRCT("$alpha") : 0.0) / 100.0;
506506
if (hscale) c->h(c->h() + hscale * (hscale > 0.0 ? 360.0 - c->h() : c->h()));
507-
if (sscale) c->s(c->s() + sscale * (sscale > 0.0 ? 100.0 - c->l() : c->s()));
507+
if (sscale) c->s(c->s() + sscale * (sscale > 0.0 ? 100.0 - c->s() : c->s()));
508508
if (lscale) c->l(c->l() + lscale * (lscale > 0.0 ? 100.0 - c->l() : c->l()));
509509
if (ascale) c->a(c->a() + ascale * (ascale > 0.0 ? 1.0 - c->a() : c->a()));
510510
return c.detach();

0 commit comments

Comments
 (0)