Get a color palette with a specific number of colors.

get_color_palette(pal_func = viridis_magma_palette, color_no = 20,
  display = TRUE, rev = FALSE, ...)

Arguments

pal_func

A function that returns the output function from colorRamp or a the output of the output function from colorRamp. Default: viridis_magma_palette

color_no

The number of colors in the palette. Default: 20

display

A logical for displaying a pie chart of the palette. Default: TRUE

rev

A logical that will reverse the order of the color palette.

...

Parameters for the pal_func.

Value

Returns a color palette in the form of a character vector.

Details

This function is meant to be a plugin style function for users to created palettes.

See also

Examples

# NOT RUN {
if(interactive()){
# This example uses data that are no longer available in the MicrobiomeR package,
# however, they can be easily generated with \code{\link{MicrobiomeR}{as_analyzed_format}}.
 library(MicrobiomeR)
analyzed_silva <- as_MicrobiomeR_format(MicrobiomeR::raw_silva_2, "analyzed_format")
 data <- analyzed_silva$data$stats_tax_data$Phylum
 data_len <- length(unique(data))
 custom_pal <- get_color_palette(color_no=data_len)
 print(custom_pal)
 }
# }