Skip to content

Commit

Permalink
Make the starting colors consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
neiljdo committed Nov 6, 2024
1 parent b8fd806 commit 8643394
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lambeq/backend/drawing/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ def _get_box_color(box: grammar.Diagrammable,
if isinstance(box, grammar.Frame) and hasattr(box, 'name'):
frame_attr = getattr(box, f'frame_{coloring_mode}')
if coloring_mode == ColoringMode.TYPE:
frame_attr += (len(FRAME_COLORS) // 7) * box.frame_order
frame_attr += (len(FRAME_COLORS) // 7) * (box.frame_order - 1)

color = FRAME_COLORS[frame_attr % len(FRAME_COLORS)]
color = FRAME_COLORS[(frame_attr - 1) % len(FRAME_COLORS)]

return color

Expand Down

0 comments on commit 8643394

Please sign in to comment.