gnome.utilities.colormaps

This module contains an assortment of colormap objects.

Each one has one method:

get_color(value_list,range=(0,255),out_type=’int’)

value_list: is a list (or any sequence) of values that you want a color to

correspond to.

range: is the range of values that define the two ends of the colormap

out_type: is the type that the RGB triple it output in. The two options are:

‘int’ : integers between 0 and 255 ‘float’: floats between 0 and 1

returned is a list of tuples, each one an RGB triple that corresponds to the values in value_list, with each value between 0 and 255.

Each one also has one attribute:

map_list: is a 256 element list of RGB triple tuples,

Each R,G,B value is an integer from 0 to 255.

You can create a new one by calling the constructor:

colormap(map_list)

and passing in your own list of tuples (it must have 256 elements)

The following colormaps are included:

autumn, bone, cool, copper, hot, hsv, jet, pink, winter

Module Contents

Classes

DistictColormap

ColorMap

NewColorMap

Functions

ourTestFunc(frac)

Attributes

NamedColorMaps

class gnome.utilities.colormaps.DistictColormap(MapName=None, map_list=None)
get_colors(ValRange=(0, 3), out_type='int')
class gnome.utilities.colormaps.ColorMap(MapName=None, val_range=None, map_list=None)
get_colors(values, out_type='int')
gnome.utilities.colormaps.NamedColorMaps
class gnome.utilities.colormaps.NewColorMap(colorFunction)

Bases: ColorMap

get_color(values, ValRange=(0, 255), out_type='int')

values – is a tuple with one entry

gnome.utilities.colormaps.ourTestFunc(frac)