summaryrefslogtreecommitdiff
path: root/lib/threads
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-07-17 21:29:44 -0400
committerLex Neva <github.com@lexneva.name>2018-07-25 21:17:58 -0400
commit3cac91a1934de8d9a341f89e9f2fa2c4b7c41a29 (patch)
tree435c30ce042652923766608febd6f6e73a75b816 /lib/threads
parentd189f88050df2db19226f50c80b0304c7bd1bd28 (diff)
update input extension for pyembroidery
Diffstat (limited to 'lib/threads')
-rw-r--r--lib/threads/color.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/threads/color.py b/lib/threads/color.py
index d94f8825..cc6c0c48 100644
--- a/lib/threads/color.py
+++ b/lib/threads/color.py
@@ -1,7 +1,7 @@
import simplestyle
import re
import colorsys
-
+from pyembroidery.EmbThread import EmbThread
class ThreadColor(object):
hex_str_re = re.compile('#([0-9a-z]{3}|[0-9a-z]{6})', re.I)
@@ -9,6 +9,12 @@ class ThreadColor(object):
def __init__(self, color, name=None, number=None, manufacturer=None):
if color is None:
self.rgb = (0, 0, 0)
+ elif isinstance(color, EmbThread):
+ self.name = color.description
+ self.number = color.catalog_number
+ self.manufacturer = color.brand
+ self.rgb = (color.get_red(), color.get_green(), color.get_blue())
+ return
elif isinstance(color, (list, tuple)):
self.rgb = tuple(color)
elif self.hex_str_re.match(color):