R/color_palette.R
get_palette.Rd
create custom color palette with color interpolation to use for QA plots interpolate the base color palette so that exact number of colors in custom palette is same as number of unique values for selected metadata category takes in an integer argument for number of colors to generate in palette (default is 3) returns a character vector of color hex codes for the desired number of colors
get_palette(num_colors = 3)
number of colors
A color palette in the form of a character vector of hex color codes.
# passing an integer directly into function
get_palette(8)
#> [1] "#00C5CD" "#912A00" "#5F7BDA" "#5AAB79" "#C1C827" "#B5B813" "#A28F91"
#> [8] "#CD00CD"
# passing a variable holding an integer value into function
number_of_colors <- 10
get_palette(number_of_colors)
#> [1] "#00C5CD" "#384D00" "#AD3471" "#B68E55" "#36AF97" "#E6E90F" "#5E6E5C"
#> [8] "#C57D8D" "#8AD138" "#CD00CD"