This function returns a palette generated by colorRampPalette from one of the Strategy Unit palettes

su_theme_pal(
  palette = c("main", "oranges", "charcoals", "slates", "reds", "blues"),
  reverse = FALSE,
  ...
)

Arguments

palette

The name of palette to use

reverse

Optional: boolean value to reverse the palette

...

arguments to pass to colorRamp

Value

A colorRamp function

Examples

su_theme_pal()
#> function (n) 
#> {
#>     x <- ramp(seq.int(0, 1, length.out = n))
#>     if (ncol(x) == 4L) 
#>         rgb(x[, 1L], x[, 2L], x[, 3L], x[, 4L], maxColorValue = 255)
#>     else rgb(x[, 1L], x[, 2L], x[, 3L], maxColorValue = 255)
#> }
#> <bytecode: 0x56037f4c1978>
#> <environment: 0x56037f4c0830>
# or, specify a paltte
su_theme_pal("oranges")
#> function (n) 
#> {
#>     x <- ramp(seq.int(0, 1, length.out = n))
#>     if (ncol(x) == 4L) 
#>         rgb(x[, 1L], x[, 2L], x[, 3L], x[, 4L], maxColorValue = 255)
#>     else rgb(x[, 1L], x[, 2L], x[, 3L], maxColorValue = 255)
#> }
#> <bytecode: 0x56037f4c1978>
#> <environment: 0x56037f560bf0>
# a reverse palette
su_theme_pal("slates", TRUE)
#> function (n) 
#> {
#>     x <- ramp(seq.int(0, 1, length.out = n))
#>     if (ncol(x) == 4L) 
#>         rgb(x[, 1L], x[, 2L], x[, 3L], x[, 4L], maxColorValue = 255)
#>     else rgb(x[, 1L], x[, 2L], x[, 3L], maxColorValue = 255)
#> }
#> <bytecode: 0x56037f4c1978>
#> <environment: 0x56037f731f08>