Skip to content

Commit 7740030

Browse files
committed
Fix missed loading of dynamic import Fixes #229
1 parent 5aaa23a commit 7740030

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# ColorHelper
22

3+
## 6.0.2
4+
5+
- **FIX**: Fix issue where default, dynamic color class wasn't always
6+
properly.
7+
38
## 6.0.1
49

510
- **FIX**: Fix absolute import reference that should have been relative.

ch_mixin.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ def get_color_options(self, pt, rule):
7474
continue
7575
module = class_options.get("class", "ColorHelper.lib.coloraide.Color")
7676
if isinstance(module, str):
77-
# Initialize the color module and cache it for this view
78-
color_class = util.import_color(module)
77+
if module == "ColorHelper.lib.coloraide.Color":
78+
# Use the base
79+
color_class = self.base
80+
else:
81+
# Initialize the color module and cache it for this view
82+
color_class = util.import_color(module)
7983
class_options["class"] = color_class
8084
else:
8185
color_class = module

ch_preview.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,12 @@ def get_color_class(self, pt, classes):
251251
if class_options is None:
252252
continue
253253
module = class_options.get("class", "ColorHelper.lib.coloraide.Color")
254-
if module == "ColorHelper.lib.coloraide.Color":
255-
color_class = self.base
256-
class_options["class"] = color_class
257-
elif isinstance(module, str):
258-
# Initialize the color module and cache it for this view
259-
color_class = util.import_color(module)
254+
if isinstance(module, str):
255+
if module == "ColorHelper.lib.coloraide.Color":
256+
color_class = self.base
257+
else:
258+
# Initialize the color module and cache it for this view
259+
color_class = util.import_color(module)
260260
class_options["class"] = color_class
261261
else:
262262
color_class = module

support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import webbrowser
66
import re
77

8-
__version__ = "6.0.1"
8+
__version__ = "6.0.2"
99
__pc_name__ = 'ColorHelper'
1010

1111
CSS = '''

0 commit comments

Comments
 (0)