Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re: palette registry/lookup #477

Open
teunbrand opened this issue Nov 4, 2024 · 1 comment
Open

Re: palette registry/lookup #477

teunbrand opened this issue Nov 4, 2024 · 1 comment

Comments

@teunbrand
Copy link
Contributor

teunbrand commented Nov 4, 2024

These are just some notes from the meeting we had off-github, so I can safely forget them in a while.

  • We should give some thoughts about 'namespacing' palette names. E.g. do we recommend packages prefix their names before palettes, so that the {foobar} package defines a "foobar::pal_xyz" palette?
  • If we go with namespaced palette names, do we automatically look these up from packages that aren't loaded?
  • Should we do away with the current registration mechanism and ensure that we lookup "foobar::pal_xyz" regardless of whether that function was registered as a palette?
    • My reservation here is that we don't know if that palette is discrete or continuous and how to convert between them.
  • Do we make a small guide about our recommendations for palette packages?
    • Consider making a testthat expectation that people can use.

Inspiration: https://github.com/EmilHvitfeldt/paletteer?tab=readme-ov-file#examples

@teunbrand
Copy link
Contributor Author

Should we do away with the current registration mechanism and ensure that we lookup "foobar::pal_xyz" regardless of whether that function was registered as a palette?

If we recommend packages export a colour vector, we can simply use as_continuous_pal(pkgname::col_vec) instead of as_continuous_pal('pkgname::col_vec'). In this case, there is no need to register a palette.

The set_palette() function is still convenient if you have a palette function instead of a colour vector. This is convenient if palettes construct their colours mathematically instead of interpolate between known colours (like pal_hue() does for example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant