Skip to contents

Internal function for the use of color palettes for continuous data or as many categories as required. This function can be used to create your own custom color palette.

Usage

make_charite_palette(palette = "primary", reverse = FALSE, ...)

Arguments

palette

Character name of palette in `charite_palettes or a custom vector of hex codes

reverse

Boolean indicating whether the palette should be reversed

...

Additional arguments passed to grDevices::colorRampPalette()

Value

A function that takes an integer n and returns n interpolated colors

Examples

pal <- make_charite_palette("goldelse")
pal(5)
#> [1] "#FAB600" "#DCD91D" "#81BE71" "#1E90AC" "#564091"
pal_rev <- make_charite_palette("mono", reverse = TRUE)
pal_rev(10)
#>  [1] "#CBCFD2" "#B9BFC3" "#A8AFB4" "#97A0A5" "#869096" "#70797F" "#545B5F"
#>  [8] "#383C3F" "#1C1E1F" "#000000"