DfE-R-Community / ggdfe

https://dfe-r-community.github.io/ggdfe/
Other
0 stars 2 forks source link

Add in a function to add custom palettes #33

Open cooke-sm opened 1 year ago

cooke-sm commented 1 year ago

It would be nice to have an add_dfe_palette function that adds in a palette specified by the user. These would need to be local and session-specific, so they don't persist across sessions. It just gives the user a bit more flexibility, especially if they've got something specific in mind that isn't supplied with the base palettes.

I've tried to do this by specifying something like:

dfe_palettes[["my_new_palette"]] <- c("#ffffff", "#kkkkkk", dfe_colours["Pink"])

But this throws an error in unexported function pal_check when you try to use it in a plot.

I think the solution lies here: https://r-pkgs.org/data.html#sec-data-state