mirror of
https://github.com/ryanamay/pint.git
synced 2024-09-20 01:50:34 +00:00
gen: colorGroup
This commit is contained in:
parent
479f34cd4d
commit
80a7a3041e
2 changed files with 857 additions and 1047 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,15 +1,23 @@
|
|||
with open('schemeGroups.js', 'a') as f:
|
||||
x = open('colors.txt','r')
|
||||
x = open('colors.txt', 'r')
|
||||
prev_line = ''
|
||||
prevComparison = ''
|
||||
groupNumber = 0
|
||||
|
||||
for current_line in x:
|
||||
value = current_line.split("=>")[0].strip()
|
||||
varName = current_line.split("=>")[0].strip().replace("#", "")
|
||||
if prev_line.split("=>")[0].strip() != current_line.split("=>")[0].strip():
|
||||
if prevComparison != value[0:7]:
|
||||
groupNumber += 1
|
||||
f.write(']\n\n// color group: '+ str(groupNumber)+ ' | default color: ' + value + '\nexport var cg' + str(groupNumber) + '_' + varName + ' = [\n')
|
||||
alphaValue = 0
|
||||
f.write(']\n\n// color group: ' + str(groupNumber) + ' | default color: ' +
|
||||
value + '\nexport var cg' + str(groupNumber) + '_' + varName + ' = [\n')
|
||||
else:
|
||||
f.write(']\n\n// color group: ' + str(groupNumber) + ' | default color: ' +
|
||||
value + '\nexport var cg' + str(groupNumber) + 'a_' + value[7:9] + ' = [\n')
|
||||
f.write('"' + current_line.split("=>")[1].strip() + '",\n')
|
||||
prev_line = current_line
|
||||
prevComparison = value[0:7]
|
||||
|
||||
x.close()
|
Loading…
Reference in a new issue