replaceColor

fun replaceColor(src: Bitmap?, fromColor: Int, targetColor: Int): Bitmap?

Replaces a color with another.

Return

Altered Bitmap.

Parameters

src

Source

fromColor

Color to be replaced.

targetColor

Color that will be used for replacing.


fun replaceColor(src: Bitmap?, map: Map<Int, Int>): Bitmap?

Replaces a color with another.

Return

Altered Bitmap.

Parameters

src

Source.

map

The key is the color that will be replaced with the mapped value.