diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5d8a10d..f4d3755 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,8 +3,9 @@
-
-
+
+
+
@@ -16,8 +17,9 @@
-
+
+
@@ -36,25 +38,25 @@
-
+
-
+
-
+
-
+
@@ -64,8 +66,8 @@
-
-
+
+
@@ -74,81 +76,58 @@
-
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -171,6 +150,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -182,7 +191,6 @@
- DIFF
Big:
starting
0x8
@@ -197,7 +205,6 @@
getCoordinate
sdfsd
getStartAndEndPointsOfLineInBox
- makeStitchLines
getBoxDiagonalLength
InfLine
to_svg
@@ -207,7 +214,13 @@
invertSlope
intersectionPath
readBytes
+ Blue
+ Stitch
+ Teal
imag
+ attributesattributes
+ loadVectorGraphic
+ makeStitchLines
@@ -222,12 +235,13 @@
-
-
+
+
+
@@ -258,6 +272,11 @@
+
+
+
+
+
@@ -325,6 +344,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -373,9 +414,11 @@
+
+
@@ -398,7 +441,7 @@
-
+
@@ -450,6 +493,17 @@
+
+
+
+
+ file://$PROJECT_DIR$/src/svgFunctions.py
+ 18
+
+
+
+
+
@@ -493,13 +547,6 @@
-
-
-
-
-
-
-
@@ -514,39 +561,20 @@
-
+
-
-
+
+
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -559,44 +587,84 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Colors/getColors.py b/Colors/getColors.py
new file mode 100644
index 0000000..04a133a
--- /dev/null
+++ b/Colors/getColors.py
@@ -0,0 +1,115 @@
+import re
+import sys
+
+# This file converts the color table for PES version 1 into something I can use in Python
+all = """
+1 007 Prussian Blue A `#1a0a94`
+2 000 Blue A `#0f75ff`
+3 534 Teal Green A `#00934c`
+4 070 Corn Flower Blue A `#babdfe`
+5 800 Red A `#ec0000`
+6 000 Reddish Brown A `#e4995a`
+7 620 Magenta A `#cc48ab`
+8 810 Light Lilac A `#fdc4fa`
+9 000 Lilac A `#dd84cd`
+10 502 Mint Green A `#6bd38a`
+11 214 Deep Gold A `#e4a945`
+12 208 Orange A `#ffbd42`
+13 000 Yellow A `#ffe600`
+14 513 Lime Green A `#6cd900`
+15 328 Brass A `#c1a941`
+16 005 Silver A `#b5ad97`
+17 000 Russet Brown A `#ba9c5f`
+18 000 Cream Brown A `#faf59e`
+19 704 Pewter A `#808080`
+20 900 Black A `#000000`
+21 000 Ultramarine A `#001cdf`
+22 000 Royal Purple A `#df00b8`
+23 707 Dark Gray A `#626262`
+24 058 Dark Brown A `#69260d`
+25 086 Deep Rose A `#ff0060`
+26 323 Light Brown A `#bf8200`
+27 079 Salmon Pink A `#f39178`
+28 000 Vermilion A `#ff6805`
+29 001 White A `#f0f0f0`
+30 000 Violet A `#c832cd`
+31 000 Seacrest A `#b0bf9b`
+32 019 Sky Blue A `#65bfeb`
+33 000 Pumpkin A `#ffba04`
+34 010 Cream Yellow A `#fff06c`
+35 000 Khaki A `#feca15`
+36 000 Clay Brown A `#f38101`
+37 000 Leaf Green A `#37a923`
+38 405 Peacock Blue A `#23465f`
+39 000 Gray A `#a6a695`
+40 000 Warm Gray A `#cebfa6`
+41 000 Dark Olive A `#96aa02`
+42 307 Linen A `#ffe3c6`
+43 000 Pink A `#ff99d7`
+44 000 Deep Green A `#007004`
+45 000 Lavender A `#edccfb`
+46 000 Wisteria Violet A `#c089d8`
+47 843 Beige A `#e7d9b4`
+48 000 Carmine A `#e90e86`
+49 000 Amber Red A `#cf6829`
+50 000 Olive Green A `#408615`
+51 107 Dark Fuchsia A `#db1797`
+52 209 Tangerine A `#ffa704`
+53 017 Light Blue A `#b9ffff`
+54 507 Emerald Green A `#228927`
+55 614 Purple A `#b612cd`
+56 515 Moss Green A `#00aa00`
+57 124 Flesh Pink A `#fea9dc`
+58 000 Harvest Gold A `#fed510`
+59 000 Electric Blue A `#0097df`
+60 205 Lemon Yellow A `#ffff84`
+61 027 Fresh Green A `#cfe774`
+62 000 Applique Material A `#ffc864`
+63 000 Applique Position A `#ffc8c8`
+64 000 Applique A `#ffc8c8`"""
+
+
+p = "(\\d+)\\t(\\d+)\\t([^\\t]+)\\tA\\t`#(\\S{6})`"
+lines = re.findall(p, all)
+
+colors = []
+
+for line in lines:
+ last = line[-1]
+ print(last)
+ r = int(last[0:2], 16)
+ g = int(last[2:4], 16)
+ b = int(last[4:6], 16)
+ color = (line[2], r, g, b)
+ colors.append(color)
+
+# Print so it can be pasted into Python source
+
+sys.stdout.write("colors = [")
+for color in colors:
+ sys.stdout.write("{}".format(color))
+ if color is not colors[-1]:
+ sys.stdout.write(", \n")
+
+sys.stdout.write("]")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index e69de29..e66a31c 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,6 @@
+
+
+
+# References
+
+Colors for PES version 1 were taken from [here.](https://edutechwiki.unige.ch/en/Embroidery_format_PEC#Stitch)
\ No newline at end of file
diff --git a/Tests/simplePath.svg b/Tests/simplePath.svg
index b7fb316..c6431bb 100644
--- a/Tests/simplePath.svg
+++ b/Tests/simplePath.svg
@@ -5,11 +5,35 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
viewBox="0 0 744.09448819 1052.3622047"
id="svg2"
- version="1.1">
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="simplePath.svg">
+
image/svg+xml
-
+
+ style="fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" />
diff --git a/src/PES.py b/src/PES.py
index 1005581..94f6e6d 100644
--- a/src/PES.py
+++ b/src/PES.py
@@ -1,5 +1,6 @@
from struct import pack
from svgpathtools import Line
+import math
def encodeU8(num):
return pack("