slot_colors | R Documentation |
Slot a set of colors into a reference set of colors
slot_colors(
given_colors,
ref_colors,
dist_threshold = NULL,
min_distance = 11.5,
return_type = c("list", "vector"),
use_white = "F5",
method = "cie2000",
do_plot = FALSE,
verbose = FALSE,
...
)
given_colors |
|
ref_colors |
|
dist_threshold |
|
min_distance |
|
return_type |
|
use_white |
|
method |
|
do_plot |
|
verbose |
|
... |
additional arguments are passed to internal functions
|
The primary purpose is for add_colors()
to determine whether
a given set of colors given_colors
are already represented,
within a given color tolerance or distance,
within a reference set of colors ref_colors
.
Colors are "slotted" into the corresponding reference colors, and un-slotted colors can be considered "not used" in the reference colors, and therefore they are available to be new colors to add to the set.
add_colors()
is recommended for most users, since it applies the
logic by calling slot_colors()
itself. However, for debugging,
in order to understand why certain colors are "slotted" and other
colors are not, slot_colors()
may be useful to call directly,
especially with do_plot=TRUE
for visual review.
Color distance metrics are imperfect, and do not represent
color blindness conditions effectively. Further, color distance
metrics are designed with different goals in mind. For example
the typical metrics are designed to ensure tolerance to a
standard color. They are not primarily designed to quantify
the magnitude of perceptible difference between two colors,
and this latter scenario is the primary motivation of
slot_colors()
and add_colors()
.
list
with length(given_colors) with integer
vectors
referencing one or more elements in ref_colors
, or NULL
.
given_colors <- rainbowJam(5)
ref_colors <- colorspace::rainbow_hcl(6)
slot_colors(given_colors, ref_colors, do_plot=TRUE)
given_colors <- rainbowJam(5)
ref_colors <- colorspace::rainbow_hcl(16)
slot_colors(given_colors, ref_colors, verbose=TRUE, do_plot=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.