Learn R Programming

ume (version 1.5.2)

f_colorz: Create Customized Color Scales

Description

Creates color scales for numeric values using predefined color palettes. The function supports optional log-transformation of the input values, handles constant vectors gracefully, and maps each numeric value to a color in the selected palette.

Usage

f_colorz(
  z,
  tf = FALSE,
  palname = "viridis",
  col_num = 100,
  verbose = FALSE,
  ...
)

Value

A character vector of colors of the same length as z.

Arguments

z

Numeric vector. Values whose colors should be computed.

tf

Logical. If TRUE, applies a transformation to the color scale (default is FALSE).

palname

Character. Name of the palette. Available palettes: "black", "redblue", "ratios", "rainbow", "awi", "viridis", "inferno", "terrain.colors", "gray".

col_num

Integer. Number of colors in the palette (default: 100).

verbose

logical; if TRUE, show progress messages.

...

Additional arguments passed to methods.