hsl2css function

String hsl2css (
  1. num alpha,
  2. List<num> hsl
)

returns an hsl css string like hsl(222, 50%, 75%, 0.6) from the hsl color and alpha value

Implementation

String hsl2css(num alpha, List<num> hsl) {
  var h = hsl[0];
  var s = hsl[1];
  var l = hsl[2];

  var _h = (h * 360).round();
  var _s = (s * 100).round();
  var _l = (l * 100).round();
  return 'hsl($_h, $_s%, $_l%, ${_clampNorm(alpha)})';
}