diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-05-17 08:35:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-17 08:35:08 +0200 |
| commit | 138aa78cb76990a91c4bf09dfa423b2081bedcbb (patch) | |
| tree | eabe95518ff46c507d0f8f2b1c2d08a26d3c67c0 | |
| parent | 1e97ad32c02840488ea7141de7f3eeb7a9aaf92b (diff) | |
fix tartan threadcount code (#2913)
| -rw-r--r-- | lib/tartan/palette.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/tartan/palette.py b/lib/tartan/palette.py index 12d191a7..6f29c9ae 100644 --- a/lib/tartan/palette.py +++ b/lib/tartan/palette.py @@ -184,7 +184,7 @@ class Palette: Threadcount: B24W4B24R2K24G24W2 - Palette: + Pallet: B=0000FFBLUE;W=FFFFFFWHITE;R=FF0000RED;K=000000BLACK;G=289C18GREEN; Threadcount given over a half sett with full count at the pivots. @@ -199,15 +199,16 @@ class Palette: self.symmetry = True colors = [] + color_dict = dict() thread_code = '' stripes = [] lines = code.splitlines() i = 0 while i < len(lines): line = lines[i].strip() - if 'Threadcount:' in line and len(lines) > i: + if 'Threadcount:' in line and len(lines) > i + 1: thread_code = lines[i+1] - elif line.startswith('Palette:'): + elif 'Pallet:' in line and len(lines) > i + 1: palette = lines[i+1] colors = re.findall(r'([A-Za-z]+)=#?([0-9afA-F]{6})', palette) color_dict = dict(colors) |
