seecol provides an interface to plotting (or "seeing") the colors of a palette or comparing multiple color palettes.

seecol has 2 main modes, based on the contents of its pal argument:

  1. if pal = "unhcr_all_pal" or a list of multiple color palettes:

    Plot visual vectors of all current color palettes for comparing them.

  2. if pal is set to a specific color palette (or a vector of multiple colors or color palettes):

    Plot the current color palette and optional details on its colors.

The title and pal_names arguments add control over plotted text labels. However, the length of a character vector provided to pal_names must correspond to the number of (custom) color palettes or colors.

seecol(
  pal = "unhcr_pal_all",
  n = "all",
  alpha = NA,
  hex = NULL,
  rgb = NULL,
  col_bg = NULL,
  col_brd = NULL,
  lwd_brd = NULL,
  grid = TRUE,
  title = NA,
  pal_names = NA,
  ...
)

Arguments

pal

A single color palette (as a vector of colors), multiple color palettes (as a list), or a recognized keyword (as a character string). Default: pal = "unhcr_pal".

Recognized keywords are:

  1. "unhcr_pal": All preferred colors and their gradients.

  2. "unhcr_pal_graphic": All preferred colors and their gradients.

  3. "unhcr_all_pal": All preferred colors and their gradients.

  4. "unhcr_pal_primary": All preferred colors and their gradients.

  5. "unhcr_pal_blue": All preferred colors and their gradients.

  6. "unhcr_pal_grey": All preferred colors and their gradients.

  7. "unhcr_pal_darkblue": All preferred colors and their gradients.

  8. "unhcr_pal_green": All preferred colors and their gradients.

  9. "unhcr_pal_red": All preferred colors and their gradients.

  10. "unhcr_pal_yellow": All preferred colors and their gradients.

seecol does also recognize keywords (e.g., "unhcr_pal")

n

Number of colors to show or use. If n is lower or higher than the length of the current color palette pal, the color palette is reduced or extrapolated (using grDevices::colorRampPalette). Default: n = "all" (i.e., show all colors in palette).

alpha

A factor modifying the opacity alpha (as in adjustcolor); typically in [0,1]. If used, the value is shown in the plot title. Default: alpha = NA (i.e., no modification of opacity).

hex

Should HEX color values be shown? Default: hex = NULL (i.e., show HEX color values when there is sufficient space to print them).

rgb

Should RGB color values be shown? Default: rgb = NULL (i.e., show RGB color values when there is sufficient space to print them).

col_bg

Color of plot background. Default: col_bg = NULL.

col_brd

Color of shape borders (if shown). Default: col_brd = NULL.

lwd_brd

Line width of shape borders (if shown). Default: lwd_brd = NULL.

grid

Show grid in the color plot? Default: grid = TRUE.

title

Plot title (as a character string). Default: title = NA creates a default title.

pal_names

Names of color palettes or colors (as a character vector). Default: pal_names = NA (for default names).

...

Other graphical parameters (passed to plot).

See also

usecol for using a color palette; unhcr_pal_all for the default unhcr color palette

Examples

{ # See multiple color palettes: seecol() # default: seecol(pal = "all") # See details of one color palette: seecol(unhcr_pal) # see a specific color palette # Combining colors or color palettes: seecol(c(rev(unhcr_pal_blue), unhcr_pal_green)) # combine color palettes seecol(c("black", "firebrick", "gold")) # combine color names # Using n to reduce or extend color palettes: seecol(n = 3) # viewing reduced ranges of all palettes seecol(n = 12) # viewing extended ranges of all palettes seecol(unhcr_pal, n = 5, title = "Reduced version of unhcr_pal (n = 5)") # reducing unhcr_pal seecol(unhcr_pal_green, n = 8, title = "Extended version of unhcr_pal_green (n = 8)") # extending unhcr_pal_green # Combining and extending color palettes: seecol(c(rev(unhcr_pal_blue), "white", unhcr_pal_red), n = 17, title = "Diverging custom color palette (with 17 colors)") # Defining custom color palettes: pal_mpg <- c("#007367", "white", "#D0D3D4") # mixing hex values and color names # Viewing extended color palette: seecol(pal_mpg, n = 9, title = "Custom color palette") ## Viewing color palettes from other packages: library(RColorBrewer) # viewing "RdBu" palette from RColorBrewer seecol(brewer.pal(name = "RdBu", n = 11)) ## Extending color palettes # extending palette to 15 colors seecol(brewer.pal(name = "RdBu", n = 11), n = 15) }
#> Error in parse_pal(pal = pal): Input "unhcr_all" does not exist