copyWith method

HSLuvColor copyWith({
  1. double? hue,
  2. double? saturation,
  3. double? lightness,
})

Returns a copy of this color with the specified fields replaced.

Implementation

HSLuvColor copyWith({double? hue, double? saturation, double? lightness}) {
  return HSLuvColor.fromHSL(
    (hue ?? this.hue).clamp(0.0, 360.0),
    (saturation ?? this.saturation).clamp(0.0, 100.0),
    (lightness ?? this.lightness).clamp(0.0, 100.0),
  );
}