Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Fix bug in scale-color with positive saturation (#2954)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zwass authored and xzyfer committed Jul 23, 2019
1 parent 58d1066 commit e913264
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fn_colors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e913264

Please sign in to comment.