fix tartan threadcount code (#2913)

pull/2916/head dev-build-kaalleen-filter-satin-paths
Kaalleen 2024-05-17 08:35:08 +02:00 zatwierdzone przez GitHub
rodzic 1e97ad32c0
commit 138aa78cb7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -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)