replace

fun replace(from: Color, to: Color): Image

Replaces a specific color in the image with another color.

Return

A new Image object with the color replaced.

Parameters

from

The color to be replaced.

to

The color to replace with.