changeHsl method

  1. @Deprecated('Use changeChannels() instead.')
SassColor changeHsl({
  1. num? hue,
  2. num? saturation,
  3. num? lightness,
  4. num? alpha,
})

Changes one or more of this color's HSL channels and returns the result.

Implementation

@Deprecated('Use changeChannels() instead.')
SassColor changeHsl({num? hue, num? saturation, num? lightness, num? alpha}) {
  if (!isLegacy) {
    throw SassScriptException(
        "color.changeHsl() is only supported for legacy colors. Please use "
        "color.changeChannels() instead with an explicit \$space argument.");
  }

  return SassColor.hsl(
          hue?.toDouble() ?? this.hue,
          saturation?.toDouble() ?? this.saturation,
          lightness?.toDouble() ?? this.lightness,
          alpha?.toDouble() ?? this.alpha)
      .toSpace(space);
}