From a7be096d71a185f1fa66464b95afcb997182b742 Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Mon, 15 Jun 2020 11:36:52 +0200 Subject: [PATCH] Make wires white by default if no color is specified --- src/wireviz.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wireviz.py b/src/wireviz.py index 19a9561..b42ff05 100755 --- a/src/wireviz.py +++ b/src/wireviz.py @@ -96,7 +96,7 @@ class Harness: dot.node(k, label=nested(l)) if len(n.loops) > 0: - dot.attr('edge',color='#000000') + dot.attr('edge',color='#000000:#ffffff:#000000') if n.ports_left: loop_side = 'l' loop_dir = 'w' @@ -141,7 +141,8 @@ class Harness: for bla in p: html = html + '{}'.format(bla) html = html + '' - html = html + ''.format(colspan=len(p), bgcolor=wv_colors.translate_color(x, 'hex'), port='w{}'.format(i)) + bgcolor = wv_colors.translate_color(x, 'hex') + html = html + ''.format(colspan=len(p), bgcolor=bgcolor if bgcolor != '' else '#ffffff', port='w{}'.format(i)) if c.shield: p = ['', 'Shield', ''] @@ -170,7 +171,7 @@ class Harness: if search_color in wv_colors.color_hex: dot.attr('edge',color='#000000:{wire_color}:#000000'.format(wire_color=wv_colors.color_hex[search_color])) else: # color name not found - dot.attr('edge',color='#000000') + dot.attr('edge',color='#000000:#ffffff:#000000') else: # it's a shield connection dot.attr('edge',color='#000000')