diff options
| author | capellancitizen <thecapellancitizen@gmail.com> | 2025-03-09 21:21:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-09 21:21:48 -0400 |
| commit | 99509df8d8abf1e7b701a4a09cf170a362f6d878 (patch) | |
| tree | a461549502fa9f37dc287789b6c7db81dfcd5368 /lib/threads | |
| parent | 0d2fc24f25f87562f0755b53dad6204efad1330d (diff) | |
Mypy type correctness (#3199)
Diffstat (limited to 'lib/threads')
| -rw-r--r-- | lib/threads/color.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/threads/color.py b/lib/threads/color.py index 58861017..e71ebb06 100644 --- a/lib/threads/color.py +++ b/lib/threads/color.py @@ -11,8 +11,6 @@ from pyembroidery.EmbThread import EmbThread class ThreadColor(object): - hex_str_re = re.compile('#([0-9a-z]{3}|[0-9a-z]{6})', re.I) - def __init__(self, color, name=None, number=None, manufacturer=None, description=None, chart=None): ''' avoid error messages: @@ -36,11 +34,9 @@ class ThreadColor(object): self.rgb = (color.get_red(), color.get_green(), color.get_blue()) return elif isinstance(color, str): - self.rgb = Color.parse_str(color)[1] + self.rgb = Color(color).to('rgb').get_values(False) elif isinstance(color, (list, tuple)): self.rgb = tuple(color) - elif self.hex_str_re.match(color): - self.rgb = Color.parse_str(color)[1] else: raise ValueError("Invalid color: " + repr(color)) |
