diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2016-06-15 11:11:37 -0700 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2016-07-13 16:33:28 +0200 |
commit | c39aa154ff7a7787b91e9c09862016afb9874254 (patch) | |
tree | 5f136d1dd921adf183ad67ca0c6d41c1c7b56df6 /grc/core/Port.py | |
parent | 893b74c770b81f2c09094577e2de720155f84b61 (diff) |
grc-refactor: move more port type color stuff to gui
Diffstat (limited to 'grc/core/Port.py')
-rw-r--r-- | grc/core/Port.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/grc/core/Port.py b/grc/core/Port.py index 9a33c5c506..4ba516d5fe 100644 --- a/grc/core/Port.py +++ b/grc/core/Port.py @@ -263,32 +263,6 @@ class Port(Element): def get_optional(self): return bool(self._optional) - def get_color(self): - """ - Get the color that represents this port's type. - Codes differ for ports where the vec length is 1 or greater than 1. - - Returns: - a hex color code. - """ - try: - color = Constants.TYPE_TO_COLOR[self.get_type()] - vlen = self.get_vlen() - if vlen == 1: - return color - color_val = int(color[1:], 16) - r = (color_val >> 16) & 0xff - g = (color_val >> 8) & 0xff - b = (color_val >> 0) & 0xff - dark = (0, 0, 30, 50, 70)[min(4, vlen)] - r = max(r-dark, 0) - g = max(g-dark, 0) - b = max(b-dark, 0) - # TODO: Change this to .format() - return '#%.2x%.2x%.2x' % (r, g, b) - except: - return '#FFFFFF' - def get_clones(self): """ Get the clones of this master port (nports > 1) |