From 240460cff48f3bf7924cfb8773847f046b61e105 Mon Sep 17 00:00:00 2001 From: KV Date: Mon, 20 Apr 2026 18:33:28 +0200 Subject: [PATCH] Handle different color specifiers A hex RGB color specifier triggered unintentionally a thicker wire as if a 2 or 3 colored wire was found. Bug reported in issue #494. Fix: Calling get_color_hex() returns a list of colors specified. Then this if expression should work independently of how each color is specified. --- src/wireviz/Harness.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index c4af2364f..6cbcf622b 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -8,6 +8,7 @@ from typing import Any, List, Union from graphviz import Graph + from wireviz import APP_NAME, APP_URL, __version__, wv_colors from wireviz.DataClasses import ( Cable, @@ -289,7 +290,7 @@ def create_graph(self) -> Graph: # determine if there are double- or triple-colored wires in the harness; # if so, pad single-color wires to make all wires of equal thickness pad = any( - len(colorstr) > 2 + len(get_color_hex(colorstr)) > 1 for cable in self.cables.values() for colorstr in cable.colors )