c4a {cols4all} | R Documentation |
Get a cols4all color palette
Description
Get a cols4all color palette: c4a
returns the colors of the specified palette, and c4a_na
returns the color for missing value that is associated with the specified palette. Run c4a_gui
to see all available palettes, which are also listed with c4a_palettes
.
Usage
c4a(
palette = NULL,
n = NA,
m = NA,
type = c("cat", "seq", "div", "bivs", "bivc", "bivd", "bivg"),
reverse = FALSE,
order = NULL,
range = NA,
format = c("hex", "RGB", "HCL"),
nm_invalid = c("error", "repeat", "interpolate"),
verbose = TRUE
)
c4a_na(palette = NULL, type = c("cat", "seq", "div"), verbose = TRUE)
Arguments
palette |
name of the palette. See |
n |
number of colors. If omitted then: for type |
m |
number of rows in case type is |
type |
type of color palette, in case |
reverse |
should the palette be reversed? |
order |
order of colors. Only applicable for |
range |
a vector of two numbers between 0 and 1 that determine the range that is used for sequential and diverging palettes. The first number determines where the palette begins, and the second number where it ends. For sequential |
format |
format of the colors. One of: |
nm_invalid |
what should be done in case |
verbose |
should messages be printed? |
Value
A vector of colors (c4a
) and a color (c4a_na
)
Examples
c4a_palettes("div")
c4a(type = "cat")
(pal = c4a("tol.sunset", n = 7, range = c(0, .6)))
c4a_plot(pal)
c4a("set2")
c4a("hcl.set2")
c4a("hcl.set2", n = 8)
# reversed palette
c4a("hcl.set2", reverse = TRUE, n = 8)
# handy shortcut
c4a("-hcl.set2", n = 8)
# the color for missing values is white:
c4a_na("hcl.set2")