Colour

Colour#

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

Bases: discopy.cat.Ob

A 0-cell, drawn using its matplotlib-compatible name.

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.