Color.createHsla constructor
HSL takes three values. The hueDegree
degree on the color wheel; '0' is
the least and '100' is the greatest. The value '0' or '360' is red, '120'
is green, '240' is blue. Numbers in between reflect different shades.
The saturationPercent
percentage; where'0' is the least and '100' is the
greatest (100 represents full color). The lightnessPercent
percentage;
where'0' is the least and '100' is the greatest. The value 0 is dark or
black, 100 is light or white and 50 is a medium lightness.
If alpha
is provided, it is the level of translucency which ranges from
'0' (completely transparent foreground) to '1.0' (completely opaque
foreground).
Implementation
Color.createHsla(num hueDegree, num saturationPercent, num lightnessPercent,
[num? alpha])
: _argb = Hsla(
Color._clamp(hueDegree, 0, 360) / 360,
Color._clamp(saturationPercent, 0, 100) / 100,
Color._clamp(lightnessPercent, 0, 100) / 100,
alpha != null ? Color._clamp(alpha, 0, 1) : alpha)
.toHexArgbString();