hsla-color()

@function hsla-color(
  $name,
  $hue: 0deg,
  $saturation: 0%,
  $lightness: 0%,
  $alpha: 0,
  $prefix: $var-prefix
) {
  $color: get-from-list($name, 'name', 'lightness', 'alpha', 'hue', 'saturation');
  @return hsla(
    hue-var(map.get($color, 'name'), map-get-default($color, 'hue', $hue), $prefix),
    saturation-var(map.get($color, 'name'), map-get-default($color, 'saturation', $saturation), $prefix),
    lightness-var(map.get($color, 'name'), calc(map-get-default($color, 'lightness', 0%) + $lightness), $prefix),
    alpha-var(map.get($color, 'name'), map-get-default($color, 'alpha', $alpha), $prefix)
  );
}

Last updated