Repeat first color in palette when loading a palette

This ensures all colors are part of the palette.
It would be better to allow the number of color wells to change.
This commit is contained in:
Isaiah Odhner 2023-07-12 01:43:59 -04:00
parent 3713e9ed00
commit 9876a3c15c

View File

@ -3441,7 +3441,7 @@ class PaintApp(App[None]):
return
global palette
palette[:len(new_colors)] = new_colors
palette[len(new_colors):] = ["#000000"] * (len(palette) - len(new_colors))
palette[len(new_colors):] = [new_colors[0]] * (len(palette) - len(new_colors))
self.query_one(ColorsBox).update_palette()
def action_get_colors(self) -> None: