Convert intensity values (e.g., a 2D slice) into a color representation for plotting and overlays.
mapToColors(
imslice,
col = heat.colors(128, alpha = 1),
zero_col = "#00000000",
alpha = 1,
irange = range(imslice),
threshold = c(0, 0)
)If alpha == 1, returns a character vector/array of colors.
If alpha < 1, returns an array with an added RGBA channel (last dimension length 4).
A numeric vector or array of intensities.
A vector of colors used as a lookup table.
Color used for exactly-zero intensities (defaults to transparent).
Global alpha multiplier applied to all colors when alpha < 1.
Intensity range used to normalize values before mapping to col.
Optional length-2 numeric vector. If diff(threshold) > 0,
values within [threshold[1], threshold[2]] are set to transparent.