Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions utilities/color_convert
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python3

import sys
import svgwrite
import xml.etree.ElementTree as ET

file = sys.argv[1] # first command line argument
stroke_color = sys.argv[2] # second command line argument

tree = ET.parse(file) # parses the svg xml
root = tree.getroot()

for element in root.iter(): # goes through all the elements in the xml and switches the stroke color
if "stroke" in element.attrib:
element.attrib["stroke"] = stroke_color

tree.write(file) # writes new xml out to file
9 changes: 9 additions & 0 deletions utilities/convert
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env python3

import pyembroidery
import sys

if len(sys.argv) < 3:
sys.exit("Usage: {} <inputfilename> <outputfilename>".format(sys.argv[0]))

pyembroidery.write(pyembroidery.read(sys.argv[1]), sys.argv[2])