-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerate.py
50 lines (45 loc) · 1.22 KB
/
generate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/python
# -*- coding: utf-8 -*-
"""_summary_
logo generator
"""
logos_to_create = [
{
'name': 'logo_base.svg',
'color-1': '#b50c36',
'color-2': 'black',
'color-3': '#aaaaaa',
'color-4': 'black',
},
{
'name': 'logo_base_white.svg',
'color-1': 'white',
'color-2': 'white',
'color-3': 'white',
'color-4': 'white',
},
{
'name': 'logo_base_white-colored.svg',
'color-1': '#b50c36',
'color-2': 'white',
'color-3': '#aaaaaa',
'color-4': 'white',
},
{
'name': 'logo_base_black.svg',
'color-1': 'black',
'color-2': 'black',
'color-3': 'black',
'color-4': 'black',
},
]
NAME = "logo_base.template"
for one_logo in logos_to_create:
with open(NAME, "r", encoding="utf-8") as f:
filedata = f.read()
filedata = filedata.replace('color-1', one_logo["color-1"])
filedata = filedata.replace('color-2', one_logo["color-2"])
filedata = filedata.replace('color-3', one_logo["color-3"])
filedata = filedata.replace('color-4', one_logo["color-4"])
with open(one_logo["name"], 'w', encoding="utf-8") as file:
file.write(filedata)