Skip to content

Add inverting functionality? #105

Description

@andrew-s28

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:
image

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:

  1. Include _i or _inverted colormaps in the cm.py file for direct access by users.
  2. Include an invert_lightness function in the tools.py file.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions