This wil create a function, that makes the palette with ramped colours.
Either a character vector with hex code, or a list that contains the character vectors with hex codes. List elements should be named.
A function that will create the ramped colors from the color vector, or of one of the vectors in the list. The function has the following parameters:
'palette', a character that indicates which of the color vectors to use.
'alpha', the desired transparancy.
'reverse', if TRUE, the direction of the colours is reversed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# devtools::install_github("RopenScilabs/ochRe") # devtools::install_github("EdwinTh/dutchmasters") # use get_pal on a single character vector my_pal <- get_pal(c("#701B06", "#78A8D1", "#E3C78F")) filled.contour(volcano, color.palette = my_pal(), asp=1) # or on a list with multiple vectors ochRe_pal <- get_pal(ochRe::ochre_palettes) dutchmasters_pal <- get_pal(dutchmasters::dutchmasters) filled.contour(volcano, color.palette = ochRe_pal(), asp=1) filled.contour(volcano, color.palette = dutchmasters_pal("anatomy", reverse = TRUE), asp=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.