withSaturation method

Color withSaturation(
  1. double saturation
)

Returns a copy of this color with the given HSL saturation (0..1).

Implementation

Color withSaturation(double saturation) => HSLColor.fromColor(this)
    .withSaturation(saturation.clamp(0.0, 1.0))
    .toColor();