withLightness method

Color withLightness(
  1. double lightness
)

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

Implementation

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