finesse.utilities.tables.NumberTable.make_colors

NumberTable.make_colors(table, colorfunc, backgroundcolorfunc, norm)[source]

Calculate the colors for the table.

Produces an array with RGB color values in the range [0, 255] for every cell by calling colorfunc(norm(table)) and backgroundcolorfunc(norm(table)).

Parameters:
tablearray

The data table without headers. Should contain numbers, but accepts arbitrary data as long as the color and norm functions can handle it.

colorfunccallable or None

A function producing RGB color data for every cell. Color values must be in [0,1]. If None the array is filled with (-1,-1,-1).

backgroundcolorfunccallable or None

A function producing RGB color data for every cell. Color values must be in [0,1]. If None the array is filled with (-1,-1,-1).

normcallable or None

A normalization applied before calling the color functions. If None it is replaced by a function that does nothing.

Returns:
color

The array produced by colorfunc

backgroundcolor

The array produced by backgroundcolorfunc