Add inverting functionality?
andrew-s28 opened this issue · 3 comments
I am hoping to get some thoughts on adding functionality for cmocean colormaps with inverted lightness. Here is an example of what this looks like:

This functionality is included in the MATLAB cmocean toolbox and some of my collaborators have made good use of it. A specific use case cited in the MATLAB example is using diverging colormaps on light backgrounds.
I see three ways this could be added:
- Include _i or _inverted colormaps in the cm.py file for direct access by users.
- Include an invert_lightness function in the tools.py file.
- Allow negative alpha values in the cmocean.tools.lighten to be interpreted as inverting lightness
One issue is that the solution I have for inverting lightness requires an additional dependency, colorspacious. Although this is already a dependency for the "cmocean[plots]" install, so perhaps not a huge leap.
@andrew-s28 I didn't know is an option in the Matlab toolbox! Cool! Yeah this would be useful. Any chance you can start on a PR?
I would be happy to. I should be able to get something together for a PR in the next few days. Thanks for your consideration!
Sounds great @andrew-s28! Let me know if you have questions along the way.