Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/palettes/material_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ def _define_named_colors(self):
# The colors are already available as pal[0], pal[1], etc.
# Now we want to add pal.BLACK = pal[0], pal.WHITE = pal[1], etc.
color_index = 0
for name, length in zip(FAMILIES, LENGTHS, strict=True):
if len(FAMILIES) != len(LENGTHS):
raise ValueError("FAMILIES and LENGTHS must have the same length")
for i, name in enumerate(FAMILIES):
length = LENGTHS[i]
if length == 1: # black or white
setattr(self, name.upper(), self[color_index])
color_index += 1
Expand Down
Loading