@@ -174,7 +174,8 @@ final List<BuiltInCallable> coreFunctions = new UnmodifiableListView([
174174 var saturation = arguments[1 ].assertNumber ("saturation" );
175175 var lightness = arguments[2 ].assertNumber ("lightness" );
176176
177- return new SassColor .hsl (hue.value, saturation.value, lightness.value);
177+ return new SassColor .hsl (hue.value, saturation.value.clamp (0 , 100 ),
178+ lightness.value.clamp (0 , 100 ));
178179 },
179180 r"$hue, $saturation" : (arguments) {
180181 // hsl(123, var(--foo)) is valid CSS because --foo might be `10%, 20%` and
@@ -208,7 +209,10 @@ final List<BuiltInCallable> coreFunctions = new UnmodifiableListView([
208209 var lightness = arguments[2 ].assertNumber ("lightness" );
209210 var alpha = arguments[3 ].assertNumber ("alpha" );
210211
211- return new SassColor .hsl (hue.value, saturation.value, lightness.value,
212+ return new SassColor .hsl (
213+ hue.value,
214+ saturation.value.clamp (0 , 100 ),
215+ lightness.value.clamp (0 , 100 ),
212216 _percentageOrUnitless (alpha, 1 , "alpha" ));
213217 },
214218 r"$hue, $saturation, $lightness" : (arguments) {
0 commit comments