Replace colors in a native raster image

nr_color_replace(nr, old, new)

Arguments

nr

native raster image

old

Vector of old colors

new

Vector of replacement colors

Value

Invisibly return the supplied native raster image which was been modified in-place

See also

Other color manipulation functions: nr_desaturate(), nr_dither(), nr_threshold()

Examples

nr <- nr_new(10, 10, 'hotpink')
nr_color_replace(nr, 'hotpink', 'grey80')
plot(nr)