changeToColorRed method

ColorDerivative changeToColorRed(
  1. double red
)

Changes the red component of this color in RGB color space.

Parameters:

  • red: The new red value, ranging from 0.0 to 255.0.

Returns: A new ColorDerivative with the updated red component.

Implementation

ColorDerivative changeToColorRed(double red) {
  return changeToColor(toColor().withRed(red.toInt()));
}