Hsla constructor

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

hue is a 0..1 fraction of 360 degrees (360 == 0). saturation is a 0..1 fraction (100% == 1). lightness is a 0..1 fraction (100% == 1). alpha is a 0..1 fraction, alpha blending between 0..1, 1 == 100% opaque.

Implementation

Hsla(num hue, num saturation, num lightness, [num? alpha])
    : _h = (hue == 1) ? 0 : Color._clamp(hue, 0, 1),
      _s = Color._clamp(saturation, 0, 1),
      _l = Color._clamp(lightness, 0, 1),
      _a = (alpha != null) ? Color._clamp(alpha, 0, 1) : alpha;