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

Shorten categorical palette URLs #191

Open
ShrimpCryptid opened this issue Jan 22, 2024 · 0 comments
Open

Shorten categorical palette URLs #191

ShrimpCryptid opened this issue Jan 22, 2024 · 0 comments
Labels
new feature New feature or request

Comments

@ShrimpCryptid
Copy link
Contributor

Use Case

Currently, if any color has changed in the categorical palette, the entire palette will be saved to the URL. This is pretty inefficient, considering that users could just be modifying one or two colors out of the 12 colors in a preset palette.

ex: "?palette=000000-000010-000020-000030-000040-000050-000060-000070-000080-000090-0000a0-0000b0"

Saving the closest palette preset AND only the colors that have changed would make this URL shorter and more human-readable. We could insert empty strings for any color that has not changed from the preset.
ex: ?palette-key=adobe&palette=--000020-00030--------
ex: ?palette-key=adobe&palette=--000020-00030 (Truncating extra - separators)

Acceptance Criteria

  • Add a utility method to find the closest preset match and return an array of changed colors from it
  • Update url_utils to show changes from a palette-key if only some colors have changed.
  • Update unit tests.

Details

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

No branches or pull requests

1 participant