diff options
Diffstat (limited to 'python/highlight.py')
| -rw-r--r-- | python/highlight.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/python/highlight.py b/python/highlight.py index 96bc543d..87329202 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) |
