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

Add from_file colormap generator and random color cycle generator #66

Open
lukelbd opened this issue Nov 19, 2019 · 0 comments
Open

Add from_file colormap generator and random color cycle generator #66

lukelbd opened this issue Nov 19, 2019 · 0 comments
Labels

Comments

@lukelbd
Copy link
Collaborator

lukelbd commented Nov 19, 2019

I want to add a few new color usage features at some point:

  • Consider adding some of the NASA colormaps listed here, and consider adding back Fabio Crameri's colormaps (version 0.5.0).
  • Add the image reader tool from climate_science_colormapping for loading colormaps. In Replace "panels" with EdgeStack, permit working directly with add_subplot/GridSpec #50 I added LinearSegmentedColormap.from_file and ListedColormap.from_file methods that load lists of hex strings, etc. I can let these methods read JPG and PNG files too. For colormaps, we try to read colors along the long-axis of the image (possibly with smoothing?), and for color cycles, we try to get distinct colors in the image. The latter would let us easily load cycles from tools like Color Hunt.
  • ProPlot can already be used to make new colormaps, but it should also be capable of making new color cycles. I can write an algorithm that selects random colors that are "sufficiently distinct" in perceptually uniform colorspace by (1) picking a random HCL coordinate, then (2) stepping in random directions in HCL space such that delta_min <= square_root(delta_chroma^2 + delta_luminance^2 + min(delta_hue, 360 - delta_hue)^2) <= delta_max. The random_cycle function should accept an initial color and the delta_min and delta_max bounds as optional arguments, and the value of delta can be randomly selected between those bounds, then randomly divided into hue, chroma, and luminance steps.

These are not a release priority but would be cool.

@lukelbd lukelbd added this to the Version 1 milestone Nov 28, 2019
@lukelbd lukelbd changed the title Add some new color usage features Add from_file colormap generator and random color cycle generator May 20, 2020
@lukelbd lukelbd removed this from the Version 0.9 milestone Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant