paleta_old: Generate Color Palettes

View source: R/paleta.R

paleta_oldR Documentation

Generate Color Palettes

Description

This function generates color palettes of various types, including sequential, categorical, or divergent, with a specified number of levels.

Usage

paleta_old(
  name,
  n = NULL,
  type = NULL,
  alpha = NULL,
  reverse = FALSE,
  recycle = TRUE
)

Arguments

name

Character string or vector, specifying the name of the palette or directly providing the colors.

n

Integer, number of colors to generate. If NULL, the default length of the palette is used.

type

Character string, type of the palette ("sequential", "categorical", or "diverging"). If NULL, inferred from the name or defaults to "categorical".

alpha

Numeric, value of alpha transparency (between 0 and 1). If NULL, no transparency is added.

reverse

Logical, if TRUE, reverses the order of the colors.

recycle

Logical, if TRUE and the palette is categorical, allows recycling of colors when n exceeds the number of available colors.

Value

A character vector of color values.

Examples

paleta("viridis", n = 5)
paleta(c("red", "green", "blue"), n = 3, type = "categorical")


jpmarindiaz/paletero documentation built on March 11, 2024, 6:42 a.m.