pal_n_sq: Get n-by-n dedicated colors of a color palette.

View source: R/color_fun.R

pal_n_sqR Documentation

Get n-by-n dedicated colors of a color palette.

Description

pal_n_sq returns n^2 dedicated colors of a color palette pal (up to a maximum of n = "all" colors).

Usage

pal_n_sq(n = "all", pal = pal_ds4psy)

Arguments

n

The desired number colors of pal (as a number) or the character string "all" (to get all colors of pal). Default: n = "all".

pal

A color palette (as a data frame). Default: pal = pal_ds4psy.

Details

Use the more specialized function unikn::usecol for choosing n dedicated colors of a known color palette.

See Also

plot_tiles to plot tile plots.

Other color objects and functions: pal_ds4psy

Examples

pal_n_sq(1)  #  1 color: seeblau3
pal_n_sq(2)  #  4 colors
pal_n_sq(3)  #  9 colors (5: white)
pal_n_sq(4)  # 11 colors (6: white)


ds4psy documentation built on Sept. 15, 2023, 9:08 a.m.