The function creates a vector of RGB values suitable for ggplot or similar.
If using the p
argument it will use one of the default palettes in the
jak_palettes
data object, or you can pass it your own colors using the
colors
argument. What makes this function useful is that it will extend
and interpolate the values of the given palette so it can return n
colors.
The final parameter is whether you want to reverse the values or not.
Details
Internally, the color palette is "ramped" using colorRampPalette()
.
Further, colors passed via the colors
argument are first checked whether
they're valid using the all_are_valid_colors()
function.