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

Interpolate palette colors in order to ensure colormaps always have the same number of colors #249

Conversation

ricardogsilva
Copy link

This PR implements interpolation of palette colors in order to better control their display by API clients.

There is a new setting ARPAV_PPCV__PALETTE_NUM_STOPS=5 which controls the size of a palette. Additionally, the color attributed to each stop in the palette is now linearly interpolated among all the colors that are defined in the corresponding .pal file. This ensures the backend is sending a fixed number of palette colors, regardless of the palette definition.

Color interpolation uses matplotlib's ListedColormap class


@ricardogsilva ricardogsilva marked this pull request as ready for review September 27, 2024 15:59
@francbartoli francbartoli merged commit 1082688 into geobeyond:main Sep 27, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

always use 5 intervals when generating a palette
2 participants