h2hwOptions | R Documentation |
Get hue color warp options used to convert color wheels
h2hwOptions(
h1 = getOption("h2hw.h1"),
h2 = getOption("h2hw.h2"),
preset = getOption("colorjam.preset", "custom"),
direction = NULL,
default_preset = "dichromat2",
reset = FALSE,
setOptions = c("FALSE", "TRUE", "ifnull"),
verbose = FALSE,
...
)
h1 |
|
h2 |
|
preset |
|
default_preset |
|
reset |
logical whether to reset |
setOptions |
|
verbose |
logical whether to print verbose output |
This function retrieves and/or defines, the h1
and h2
hue vectors used to convert between h1
"hue warp", and
h2
"actual hue".
The "actual" hue is used by standard R #' functions such as
colorspace::polarLUV()
, grDevices::hcl()
, and
farver::convert_colour()
.
The mapping from h1
to h2
allows customization of the spacing
and order of colors, which allows emulation of a red-yellow-blue
color wheel for example.
The h1
represents the color hue in terms of a degree angle ranging
from 0 to 360 - a full circle - for the observer. It is then
transformed to h2
for use in generating actual R colors.
colorjam_presets()
lists all recognized colorjam presets.
add_colorjam_preset()
will add or overwrite a colorjam preset by name.
In general, most colorjam functions with argument preset
will
follow this progression:
Argument preset=getOption("colorjam.preset", "custom")
which uses preset
when defined, otherwise "custom"
.
When this option matches a recognized preset name, the
corresponding h1
,h2
values are used.
When preset="custom"
, arguments h1
,h2
will also
poll getOption("h2hw.h1")
and getOption("h2hw.h2")
for
default values.
When neither h1
,h2
is defined, the argument
default_preset="dichromat"
is used to obtain h1
,h2
values.
To disable the warped hue mechanic, set preset="rgb"
which
usess the default R color wheel with no adjustment.
The h1
,h2
values are passed to approx_degrees()
to convert
hue degree angles. See adjust_hue_warp()
for detailed examples
of manipulating color warp values.
list with names h1
and h2
containing numeric vectors
of hues between 0 and 360.
Other colorjam hue warp:
add_colorjam_preset()
,
add_colorjam_step()
,
adjust_hue_warp()
,
approx_degrees()
,
colorjam_presets()
,
colorjam_steps()
,
display_degrees()
,
h2hw()
,
hcl_to_hsl_hue()
,
hsl_to_hcl_hue()
,
hw2h()
,
mean_angle()
,
plot_colorjam_preset()
,
remap_colorjam_preset()
,
validate_colorjam_preset()
Other hue warp functions:
h2hw()
h2hwOptions()
h2hw(60)
h2hwOptions(h1=c(0, 60,120,240,300,360),
h2=c(0,120,180,240,280,360))
h2hw(300)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.