Model.setcolor#

Model.setcolor(index, red, green, blue)#

Set a colormap entry for the entity colors.

Parameters:
  • index (int) – Specifies the color location (0 to 63)

  • red (int) – The red component of the color. ( 0 through 255)

  • green (int) – The green component of the color. ( 0 through 255)

  • blue (int) – The blue component of the color. ( 0 through 255)

Note

The changes do not take effect until you redraw the display.

Examples#

Set the custom colormap to index 9 with RGB to [ 0,0,255 ]#
import hm
import hm.entities as ent

model = hm.Model()

model.setcolor(index=9, red=0, green=0, blue=255)