diff options
| author | KyleMiles <krm504@nyu.edu> | 2022-01-27 22:43:28 -0500 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2022-01-28 00:24:06 -0500 |
| commit | 6812c973c9fa9b4ad642ab81856c05f87bd6fcc4 (patch) | |
| tree | dace4156d03148bcaf02df138ab4e0d93e61bc6f /python/highlight.py | |
| parent | 519c9db22367f2659d1a54599fab47e6313be06e (diff) | |
Format All Files
Diffstat (limited to 'python/highlight.py')
| -rw-r--r-- | python/highlight.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/python/highlight.py b/python/highlight.py index b1666f54..a224ef30 100644 --- a/python/highlight.py +++ b/python/highlight.py @@ -18,14 +18,13 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. - # Binary Ninja components from . import _binaryninjacore as core from .enums import HighlightColorStyle, HighlightStandardColor class HighlightColor: - def __init__(self, color = None, mix_color = None, mix = None, red = None, green = None, blue = None, alpha = 255): + def __init__(self, color=None, mix_color=None, mix=None, red=None, green=None, blue=None, alpha=255): if (red is not None) and (green is not None) and (blue is not None): self._style = HighlightColorStyle.CustomHighlightColor self._red = red @@ -141,10 +140,13 @@ class HighlightColor: return "<color: %s, alpha %d>" % (self._standard_color_to_str(self.color), self.alpha) if self.style == HighlightColorStyle.MixedHighlightColor: if self.alpha == 255: - return "<color: mix %s to %s factor %d>" % (self._standard_color_to_str(self.color), - self._standard_color_to_str(self.mix_color), self.mix) - return "<color: mix %s to %s factor %d, alpha %d>" % (self._standard_color_to_str(self.color), - self._standard_color_to_str(self.mix_color), self.mix, self.alpha) + return "<color: mix %s to %s factor %d>" % ( + self._standard_color_to_str(self.color), self._standard_color_to_str(self.mix_color), self.mix + ) + return "<color: mix %s to %s factor %d, alpha %d>" % ( + self._standard_color_to_str(self.color), self._standard_color_to_str(self.mix_color + ), self.mix, self.alpha + ) if self.style == HighlightColorStyle.CustomHighlightColor: if self.alpha == 255: return "<color: #%.2x%.2x%.2x>" % (self.red, self.green, self.blue) @@ -184,4 +186,3 @@ class HighlightColor: elif color.style == HighlightColorStyle.CustomHighlightColor: return HighlightColor(red=color.r, green=color.g, blue=color.b, alpha=color.alpha) return HighlightColor(color=HighlightStandardColor.NoHighlightColor) - |
