Skip to contents

This function gets a pallete by name from the list ("main" by default), has a boolean condition determining whether to reverse the order or not, and additional arguments to pass on to colorRampPallete() (such as an alpha value).

Usage

mengbo_pal(palette = "main", reverse = FALSE, ...)

Arguments

palette

Character name of palette in mengbo_palettes

reverse

Boolean indicating whether the palette should be reversed

...

Additional arguments to pass to colorRampPalette()

Value

Another function.

Note

Changes or new color palettes are added in this list.

Examples

mengbo_pal("main", alpha = 0.8)
#> 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: 0x564380bea160>
#> <environment: 0x564380be8f70>
mengbo_pal("cool")(10)
#>  [1] "#884EC7" "#6854C2" "#495ABD" "#2A61B8" "#3873AB" "#48869E" "#579992"
#>  [8] "#55A78D" "#53B588" "#52C484"