Colour

Colour#

class discopy.monoidal.Colour(name, label=None)[source]#

Bases: discopy.cat.Ob

A 0-cell, drawn using its matplotlib-compatible name. A region with no colour is None, drawn as the page.

An optional label gives the region a human-readable name for the drawing legend (e.g. a category) while still filling with name. It is ignored for equality and hashing, so two regions with the same fill colour still merge.

Parameters:
  • name (str)

  • label (str | None)

property legend_label: str#

The name shown for this colour in a drawing legend.