Return function to interpolate a mengbo color palette
mengbo_pal.RdThis 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).
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"