fastplotlib.graphics._features.ColorFeature

class ColorFeature(parent, colors, n_colors, alpha=1.0, collection_index=None)[source]

Manages the color buffer for LineGraphic or ScatterGraphic

event pick info:

key

type

description

“index”

numpy.ndarray or None

changed indices in the buffer

“new_data”

numpy.ndarray or None

new buffer data at the changed indices

“collection-index”

int

the index of the graphic within the collection that triggered the event

“world_object”

pygfx.WorldObject

world object

Parameters:
  • parent (Graphic or GraphicCollection)

  • colors (str, array, or iterable) – specify colors as a single human readable string, RGBA array, or an iterable of strings or RGBA arrays

  • n_colors (int) – number of colors to hold, if passing in a single str or single RGBA array

  • alpha (float) – alpha value for the colors