Skip to content

Commit 267df0d

Browse files
authored
Merge pull request #2113 from mgreter/bugfix/issue-2112
Fix error whit hue color change function
2 parents c6a8169 + 7b5f46c commit 267df0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/functions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ namespace Sass {
819819
}
820820
if (hsl) {
821821
HSL hsl_struct = rgb_to_hsl(color->r(), color->g(), color->b());
822-
if (h) hsl_struct.h = static_cast<double>(((static_cast<int>(h->value()) % 360) + 360) % 360) / 360.0;
822+
if (h) hsl_struct.h = std::fmod(h->value(), 360.0);
823823
if (s) hsl_struct.s = ARGR("$saturation", Number, 0, 100)->value();
824824
if (l) hsl_struct.l = ARGR("$lightness", Number, 0, 100)->value();
825825
double alpha = a ? ARGR("$alpha", Number, 0, 1.0)->value() : color->a();

0 commit comments

Comments
 (0)