c4a_gui | R Documentation |
Graphical user interface to analyse palettes. c4a_table
shows a table that can be opened in the browser. c4a_gui
is a graphical user interface (shiny app) around this table.
c4a_gui(type = "cat", n = NA, series = "all")
c4a_table(
type = c("cat", "seq", "div", "cyc", "bivs", "bivc", "bivd", "bivg"),
n = NULL,
m = NULL,
continuous = FALSE,
filters = character(0),
cvd.sim = c("none", "deutan", "protan", "tritan"),
sort = "name",
text.format = "hex",
text.col = "same",
series = "all",
range = NA,
colorsort = "orig",
include.na = FALSE,
show.scores = FALSE,
columns = NA,
verbose = TRUE
)
type |
type of palette. Run |
n , m |
|
series |
Series of palettes to show. See |
continuous |
should the palettes as continuous instead of discrete. Only applicable for |
filters |
filters to be applied. A character vector with a subset from: |
cvd.sim |
color vision deficiency simulation: one of |
sort |
column name to sort the data. The available column names depend on the arguments |
text.format |
The format of the text of the colors. One of |
text.col |
The text color of the colors. By default |
range |
vector of two numbers that determine the range that is used for sequential and diverging palettes. Both numbers should be between 0 and 1. The first number determines where the palette begins, and the second number where it ends. For sequential palettes, 0 means the leftmost (normally lightest) color, and 1 the rightmost (often darkest) color. For diverging palettes, 0 means the middle color, and 1 both extremes. If only one number is provided, this number is interpreted as the endpoint (with 0 taken as the start). By default, it is set automatically, based on |
colorsort |
Sort the colors ( |
include.na |
should color for missing values be shown? |
show.scores |
should scores of the quality indicators be printed? See details for a description of those indicators. |
columns |
number of columns. By default equal to |
verbose |
should messages and warnings be printed? |
See vignette how the properties are calculated. Parameters, such as threshold values which determined when palettes are classified as "colorblind-friendly", can be specified via c4a_options
. Also the nameability score function (which is in development) can be specified there. See the examples of c4a_options
for both use cases.
An HMTL table (kableExtra
object)
References of the palettes: cols4all-package
.
if (requireNamespace("shiny") &&
requireNamespace("shinyjs") &&
requireNamespace("kableExtra") &&
requireNamespace("colorblindcheck") &&
interactive()) {
c4a_gui()
# categorical palettes with maximum number of colors
c4a_table(type = "cat")
# sort sequential palettes by hue
c4a_table(type = "seq", n = 7, sort = "H")
# sort sequential palettes by hue type (how many hues are used)
c4a_table(type = "seq", n = 5, sort = "hues")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.