Compare commits

..

2 Commits

2 changed files with 13 additions and 6 deletions

View File

@@ -19,8 +19,5 @@ Where "file_format" could be:
Where "input_csv" would be your input csv as in swatchos.csv
Where "output_file" could be:
- swatchos.gpl
- swatchos.xml
- swatchos.kpl
Replacing swatchos with your colour palette name
Where "output_file" is the name of your palette, the required extension is added automatically

12
main.py
View File

@@ -3,7 +3,17 @@ import csv
def main(file_format, input, output):
with open(input, newline='') as csvfile, open(output, "w") as out:
output_file_format = ""
match file_format:
case "gpl":
output_file_format = f"{output}.gpl"
case "scribus":
output_file_format = f"{output}.xml"
case: "krita":
output_file_format = f"{output}.kpl"
with open(input, newline='') as csvfile, open(output_file_format, "w") as out:
code_reader = csv.reader(csvfile, delimiter=',')
next(code_reader)