pth_palette_join | R Documentation |
Use this function to join two sequential palettes into a diverging palette.
pth_palette_join(palette_low, palette_high, ...) ## Default S3 method: pth_palette_join(palette_low, palette_high, ...) ## S3 method for class 'pth_palette_hex' pth_palette_join(palette_low, palette_high, ...) ## S3 method for class 'pth_palette_path' pth_palette_join(palette_low, palette_high, ...)
palette_low, palette_high |
|
... |
other args (not used) |
function
with S3 class pth_palette
,
same as palette_low
, palette_high
.
# both these palettes go from light grey to a darker color pal_hex_blue <- pth_new_palette_hex(c("#e2e2e2", "#9cbaee", "#3c79c0")) pal_hex_orange <- pth_new_palette_hex(c("#e2e2e2", "#e0af85", "#a66a00")) # palette_low (in this case, blue) is reversed, # putting the light grey in the middle pal_hex_join <- pth_palette_join(pal_hex_blue, pal_hex_orange) # recover the original hex codes pal_hex_join(seq(0, 1, by = 0.25)) %>% pth_to_hex()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.