SassColor.hsl constructor Null safety

SassColor.hsl(
  1. num hue,
  2. num saturation,
  3. num lightness,
  4. [num? alpha]
)

Creates an HSL color.

Throws a RangeError if saturation or lightness aren't between 0 and 100, or if alpha isn't between 0 and 1.

Implementation

SassColor.hsl(num hue, num saturation, num lightness, [num? alpha])
    : _hue = hue % 360,
      _saturation = fuzzyAssertRange(saturation, 0, 100, "saturation"),
      _lightness = fuzzyAssertRange(lightness, 0, 100, "lightness"),
      _alpha = alpha == null ? 1 : fuzzyAssertRange(alpha, 0, 1, "alpha"),
      originalSpan = null;