The col_pal must be a string vector of hexadecimal RGB or RGBa color codes.

bin_color(x, col_pal = "rainbow", output_format = c("hex9", "hex7"))

Arguments

x

A numeric vector whose magnitudes should be binned onto the color palette.

col_pal

Color palette to bin numeric values into. See details.

output_format

Whether the output should be RGBa (hex9) or RGB (hex7).

Details

Given a numeric vector x, bins the values from low to high on a given color gradient. Defaults to the reversed rainbow gradient, where blue == low, red == high.