Add logoColorGenerator and svg sources
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 79 KiB |
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"violet":
|
||||||
|
[
|
||||||
|
["6800e7","6800e7"],
|
||||||
|
["40008b","40008b"],
|
||||||
|
["2a005e","2a005e"],
|
||||||
|
["15002f","15002f"]
|
||||||
|
],
|
||||||
|
"pink":
|
||||||
|
[
|
||||||
|
["6800e7","b239ff"],
|
||||||
|
["40008b","670096"],
|
||||||
|
["2a005e","450069"],
|
||||||
|
["15002f","240039"]
|
||||||
|
],
|
||||||
|
"blue":
|
||||||
|
[
|
||||||
|
["6800e7","03abeb"],
|
||||||
|
["40008b","0079a7"],
|
||||||
|
["2a005e","004c69"],
|
||||||
|
["15002f","002b3b"]
|
||||||
|
],
|
||||||
|
"turquise":
|
||||||
|
[
|
||||||
|
["6800e7","02fae0"],
|
||||||
|
["40008b","01a08f"],
|
||||||
|
["2a005e","01564d"],
|
||||||
|
["15002f","001b18"]
|
||||||
|
],
|
||||||
|
"red":
|
||||||
|
[
|
||||||
|
["6800e7","fd294f"],
|
||||||
|
["40008b","ae1d37"],
|
||||||
|
["2a005e","721425"],
|
||||||
|
["15002f","310810"]
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def loadColorTables(fn = 'colortables.json'):
|
||||||
|
with open(fn) as f:
|
||||||
|
return json.loads(f.read())
|
||||||
|
|
||||||
|
def readSrcSvg(fn = 'franconianNet.svg'):
|
||||||
|
with open(fn) as f:
|
||||||
|
return f.read()
|
||||||
|
|
||||||
|
def replaceColors(svg, table):
|
||||||
|
for mapping in table:
|
||||||
|
svg = svg.replace(mapping[0], mapping[1])
|
||||||
|
return svg
|
||||||
|
|
||||||
|
def genAll(srcFN = 'franconianNet.svg', tablesFN='colortables.json'):
|
||||||
|
tables = loadColorTables(tablesFN)
|
||||||
|
src = readSrcSvg(srcFN)
|
||||||
|
|
||||||
|
for name in tables:
|
||||||
|
repl = replaceColors(src , tables[name])
|
||||||
|
with open(srcFN.split(".")[0]+"_"+name+".svg", "w") as fo:
|
||||||
|
fo.write(repl)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
genAll(sys.argv[1], sys.argv[2])
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 79 KiB |