add_colorjam_preset | R Documentation |
Add colorjam hue warp preset
add_colorjam_preset(
preset,
h1,
h2 = NULL,
direction = 1,
default_step = NULL,
description = NULL,
verbose = TRUE,
...
)
preset |
|
h1 , h2 |
|
direction |
|
default_step |
|
description |
|
... |
additional arguments are ignored. |
The colorjam presets represent customized color wheels, used for various color operations.
h1
contains actual color hue values, with range c(0, 360)
.
Its values are intended to be used in HCL color hue operations,
such as jamba::hcl2col()
, or colorspace::polarLUV()
. These
are not equal to HSV
or HLS
(also known as HSL) color hues,
although colorjam preset could be used to convert from HCL to HSV.
h2
contains virtual color hue values, with range c(0, 360)
.
These values are intended to represent the full virtual color
wheel, mapping the virtual hue h2
to actual hue h1
.
Not all values in h1
need be represented, in fact "dichromat"
presets explicitly remove a sizable chunk of green color hues.
direction
the direction of h1
relative to h2
encoded as:
1
for forward direction, and
-1
for reverse direction.
default_step
used primarily by rainbowJam()
to define the
appropriate Chroma/Luminance stepping pattern when choosing
actual HCL colors around the color wheel.
optional attribute "description"
as attr(x, "description")
.
TRUE
, invisibly.
Other colorjam hue warp:
add_colorjam_step()
,
adjust_hue_warp()
,
approx_degrees()
,
colorjam_presets()
,
colorjam_steps()
,
display_degrees()
,
h2hwOptions()
,
h2hw()
,
hcl_to_hsl_hue()
,
hsl_to_hcl_hue()
,
hw2h()
,
mean_angle()
,
plot_colorjam_preset()
,
remap_colorjam_preset()
,
validate_colorjam_preset()
h1 <- c(8, 30, 65,
120, 200, 240,
260, 280, 330)
h2 <- c(115, 35.9, -3.7,
-3.7, -3.7, -3.7,
-70.9, -189.6, -229.2)
add_colorjam_preset("custom_dichromat",
h1=h1, h2=h2, direction=-1, default_step="v24",
description="Custom dichromat example")
# behold the new preset name appears
colorjam_presets()
# the preset data is available
colorjam_presets("custom_dichromat")
# the preset is used to create rainbow categorical colors
color_pie(rainbowJam(n=10,
preset="custom_dichromat"))
# remove a preset by defining `h1=NULL`
add_colorjam_preset("custom_dichromat", h1=NULL)
colorjam_presets()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.