Skip to content

Simplify colormap handling #1004

Description

@kushalkolar

As Almar suggested here we can just migrate to pygfx.cm.create_colormap(). This will make things easier and let us use custom colormaps with whatever number of custom colors. This is necessary for @KceniaB usecase with the probability heatmaps.

Can create a TextureMap like this with using the cmap library to generate the cmap array as well:

texture_map = gfx.cm.create_colormap(cmap.Colormap(["r", "cyan", "magenta"]).lut(3), n=3)

Can then just set this on material.map for images, and texcoords for geometries (lines, scatters, meshes).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions