anim.colormap

class anim.colormap(name='turbo', range=[0, 1], ncolors=64)

A class to manage colormaps It is mainly used to convert scaler values to colors.

__init__(name='turbo', range=[0, 1], ncolors=64)

Colormap constructor

Defines the basic attributes of a colormap, namely the number of colors ncolors and value range range.

The name of the colormap is either provided to the constructor or set later on with the set method.

Parameters:
  • name (string) – The name of the colormap. All the names from Matplotlib are accepted. Default: ‘turbo’

  • range (list) – The range of the colormap. Default: [0,1]

  • ncolors (int) – The number of colors in the colormap. Default: 64

Methods

__init__([name, range, ncolors])

Colormap constructor

colortable()

htmlcolor(value[, scaled])

Convert a scalar value in an html color (string).

qcolor(value[, scaled])

Convert a scalar value in a Qt color (QColor).

set(name)

Set colormap's name.