Skip to contents

Plots color examples with contrasting text. Parameters are passed to contrast_text.

Usage

color_plot(
  colors,
  labels = TRUE,
  borders = NULL,
  cex_label = 1,
  ncol = NULL,
  ...
)

Arguments

colors

Vector of colors to plot

labels

Show color names. Default is TRUE

borders

Border parameter for 'rect()' function. Default is NULL

cex_label

Label size. Default is 1.

ncol

Desired number of columns. Default is ceiling of square root to the length of 'colors' vector provided.

...

Parameters for the

Value

base plot

Examples

par(bg=NULL)
#> named list()
colors <- sample(colors(),size = 20)
color_plot(colors, method="relative")