withRed method

  1. @override
HslColor withRed(
  1. num red
)
override

Returns a new color that matches this color with the red channel replaced with r (which ranges from 0 to 255).

Out of range values will have unexpected effects.

Implementation

@override
HslColor withRed(num red) {
  assert(red >= 0 && red <= 255);
  return toRgbColor().withRed(red).toHslColor();
}