summaryrefslogtreecommitdiff
path: root/python/highlight.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/highlight.py')
-rw-r--r--python/highlight.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/highlight.py b/python/highlight.py
index 55246a9a..502caa80 100644
--- a/python/highlight.py
+++ b/python/highlight.py
@@ -110,3 +110,13 @@ class HighlightColor(object):
result.b = self.blue
return result
+
+ @staticmethod
+ def _from_core_struct(color):
+ if color.style == HighlightColorStyle.StandardHighlightColor:
+ return HighlightColor(color=color.color, alpha=color.alpha)
+ elif color.style == HighlightColorStyle.MixedHighlightColor:
+ return HighlightColor(color=color.color, mix_color=color.mixColor, mix=color.mix, alpha=color.alpha)
+ elif color.style == HighlightColorStyle.CustomHighlightColor:
+ return HighlightColor(red=color.r, green=color.g, blue=color.b, alpha=color.alpha)
+ return HighlightColor(color=HighlightStandardColor.NoHighlightColor)