diff --git a/utilities/color_convert b/utilities/color_convert new file mode 100644 index 0000000..0ed02a3 --- /dev/null +++ b/utilities/color_convert @@ -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 \ No newline at end of file diff --git a/utilities/convert b/utilities/convert new file mode 100755 index 0000000..785ee21 --- /dev/null +++ b/utilities/convert @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import pyembroidery +import sys + +if len(sys.argv) < 3: + sys.exit("Usage: {} ".format(sys.argv[0])) + +pyembroidery.write(pyembroidery.read(sys.argv[1]), sys.argv[2])