Merge pull request #5 from kvid/kvid/feature-multicolor-wires

Reverse colors to match the curved wires when more than 2 colors
This commit is contained in:
Andrew Katz 2020-06-25 17:33:04 -04:00 committed by GitHub
commit 9cd46e4f43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,7 @@ class Harness:
html = html + '</tr>' html = html + '</tr>'
bgcolors = ('#000000:' + wv_colors.translate_color(x, 'hex') +':#000000').split(':') bgcolors = ('#000000:' + wv_colors.translate_color(x, 'hex') +':#000000').split(':')
html = html + '<tr><td colspan="{colspan}" border="0" cellspacing="0" cellpadding="0" port="{port}" height="{height}"><table cellspacing="0" cellborder="0" border = "0">'.format(colspan=len(p), port ='w{}'.format(i), height = '{}'.format(2*len(bgcolors))) html = html + '<tr><td colspan="{colspan}" border="0" cellspacing="0" cellpadding="0" port="{port}" height="{height}"><table cellspacing="0" cellborder="0" border = "0">'.format(colspan=len(p), port ='w{}'.format(i), height = '{}'.format(2*len(bgcolors)))
for j, bgcolor in enumerate(bgcolors): for j, bgcolor in enumerate(bgcolors[::-1]): # Reverse to match the curved wires when more than 2 colors
html = html + '<tr><td colspan="{colspan}" cellpadding="0" height="2" bgcolor="{bgcolor}" border="0"></td></tr>'.format(colspan=len(p), bgcolor=bgcolor if bgcolor != '' else '#ffffff') html = html + '<tr><td colspan="{colspan}" cellpadding="0" height="2" bgcolor="{bgcolor}" border="0"></td></tr>'.format(colspan=len(p), bgcolor=bgcolor if bgcolor != '' else '#ffffff')
html = html + '</table></td></tr>' html = html + '</table></td></tr>'