Compare commits
2 Commits
645ce55db3
...
ed662b285c
| Author | SHA1 | Date | |
|---|---|---|---|
| ed662b285c | |||
| 09a6a97c57 |
@@ -19,8 +19,5 @@ Where "file_format" could be:
|
|||||||
|
|
||||||
Where "input_csv" would be your input csv as in swatchos.csv
|
Where "input_csv" would be your input csv as in swatchos.csv
|
||||||
|
|
||||||
Where "output_file" could be:
|
Where "output_file" is the name of your palette, the required extension is added automatically
|
||||||
- swatchos.gpl
|
|
||||||
- swatchos.xml
|
|
||||||
- swatchos.kpl
|
|
||||||
Replacing swatchos with your colour palette name
|
|
||||||
|
|||||||
12
main.py
12
main.py
@@ -3,7 +3,17 @@ import csv
|
|||||||
|
|
||||||
def main(file_format, input, output):
|
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=',')
|
code_reader = csv.reader(csvfile, delimiter=',')
|
||||||
next(code_reader)
|
next(code_reader)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user