as_pal_hex | R Documentation |
The "standard" palette function in this package takes a numeric input
(0 <= x <=1
) and returns a matrix output (LUV coordinates).
Perhaps you want a palette function to return hex-codes; use as_pal_hex()
.
Perhaps you want a palette function to act as a discrete-palette function;
use as_pal_disc()
.
It is important to keep in mind that each of these functions returns a function.
as_pal_hex(pal_luv) as_pal_disc(pal)
pal_luv |
|
pal |
|
function
:
as_pal_hex()
return a palette function that returns hex-codes.
as_pal_disc()
return a discrete-palette function which takes
an integer input n
, and returns n
equally-distributed values.
# create LUV palette-function pal_blues <- pal_luv_bezier(mat_luv_blues) # create hex palette-function pal_blues_hex <- as_pal_hex(pal_blues) # evaluate pal_blues_hex(seq(0, 1, by = 0.2)) # create a discrete hex palette-function pal_blues_hex_disc <- as_pal_disc(pal_blues_hex) # evaluate pal_blues_hex_disc(6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.