A convenience function to Vizualize colors by either color name or color code.

plot_colors(
  col,
  text = as.character(col),
  Title = "Colors",
  cex = 1.2,
  as.legend = FALSE,
  ...
)

Arguments

col

A list of either color names or color codes.

text

Strings that describe each color.

cex

character expansion factor relative to current par("cex"). Used for text, and provides the default for pt.cex.

Value

A plot made with R package graphics.

Author

Vilmantas Gegzna

Examples


plot_colors("#ee0000")

plot_colors("#ee0000", "RED color")

plot_colors(c("red","red4","orange2","green3","skyblue"))