| validate_colorjam_preset | R Documentation |
Validate h1,h2 color hue warp data, internal function
validate_colorjam_preset(
h1 = NULL,
h2 = NULL,
direction = NULL,
default_step = NULL,
preset = NULL,
digits = 4,
...
)
h1, h2 |
|
direction |
|
digits |
|
... |
additional arguments are ignored. |
Validate the h1,h2 color hue values alongside the direction
the angles should proceed. This function handles cases where
h2 contains duplicate values, which is used to remove a
section of h1 from the output h2 color wheel. Duplicated
values are not handled well by approx(), so this function
rounds values to 4 digits, then sorts data based upon direction,
then finally adjusts any duplicated h2 values by adding
1e-8.
h1,h2 angles are adjusted within range c(0, 360) using
x %% 360.
h1,h2 values are rounded using round(x, digits=digits)
h1,h2 values are sorted by h2 increasing, and h1
in order of direction
Duplicated h2 values are adjusted by adding c(0, 1, 2, ...) + 1e-8
to each duplicated value, per set of duplicated values.
The first duplicated value in each set is unchanged, and
subsequent values in the set are increased by 1e-8.
Enforce sensible ordering of values, mainly so the R-shiny app
h1,h2 edited values will permit pushing identical values.
For example, two identical h2 values cause the corresponding
h1 values to be skipped, thus removing that range of hues.
When one h2 value is increased, it should also increase subsequent
values.
list with components:
h1: HCL color hue indicating the actual hue to be used
when generating a color.
h2: HCL color hue indicating the virtual hue assigned to each
actual hue in h1.
direction: with 1 indicating forward (increasing, clockwise)
progression around the color wheel, and -1 indicating reverse
(decreasing, counter-clockwise) progression around the color
wheel.
default_step: character string with name matching a
value returned by colorjam_steps()
Other colorjam hue warp:
add_colorjam_preset(),
add_colorjam_step(),
adjust_hue_warp(),
approx_degrees(),
colorjam_presets(),
colorjam_steps(),
display_degrees(),
h2hw(),
h2hwOptions(),
hcl_to_hsl_hue(),
hsl_to_hcl_hue(),
hw2h(),
mean_angle(),
plot_colorjam_preset(),
remap_colorjam_preset()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.