Skip to content

[bug] Using HTML color code changes wire thickness #494

Open

Description

@esromneb

I've found that if I only use the color abbreviations the diagram looks one way. If I add a single quoted html color code, the wire thickness across the entire diagram changes, as well as other minor visual changes

Before

connectors:
  MOTORDRIVER:
    type: Motor Driver
    pinlabels: [12V, GND, 5V, IN1, IN2, IN3, IN4, OUT1, OUT2, OUT3, OUT4]
  ESP32:
    type: ESP32
    pinlabels: [GND, 3V3, USBN, USBP, P4, P33, P34, P47, P48]

cables:
  SIGNALMOTORDRIVER:
    wirecount: 2
    colors: [BU, OG]
    type: Jumper Wire

connections:
  -
    - ESP32: [8, 9]
    - SIGNALMOTORDRIVER: [1, 2]
    - MOTORDRIVER:       [6, 7]

Before output

Image

After

connectors:
  MOTORDRIVER:
    type: Motor Driver
    pinlabels: [12V, GND, 5V, IN1, IN2, IN3, IN4, OUT1, OUT2, OUT3, OUT4]
  ESP32:
    type: ESP32
    pinlabels: [GND, 3V3, USBN, USBP, P4, P33, P34, P47, P48]

cables:
  SIGNALMOTORDRIVER:
    wirecount: 2
    colors: [BU, "#ffcf80"]
    type: Jumper Wire

connections:
  -
    - ESP32: [8, 9]
    - SIGNALMOTORDRIVER: [1, 2]
    - MOTORDRIVER:       [6, 7]

After output

Image

Version

# wireviz --version

WireViz 0.4.1

# python3 --version
Python 3.10.12

Activity

  1. kvid commented on Apr 19, 2026

    @kvid
    Collaborator

    @esromneb - thank you for reporting this bug. I have verified it, and found the root cause at https://github.com/wireviz/WireViz/blob/master/src/wireviz/Harness.py#L292

    The intention is to increase the wire thickness of single colored wires to match any existing double or triple colored wires in the diagram. However, the code line linked above is currently only able to handle colors specified as 2 letter codes. It needs an update!

  2. added
    bugSomething isn't working
    on Apr 19, 2026
  3. kvid commented on Apr 19, 2026

    @kvid
    Collaborator

    I''m not able to test it right now, but the code len(colorstr) > 2 probably should be replaced by len(get_color_hex(colorstr)) > 1 to also handle other ways to specify a color.

  4. linked a pull request that will close this issueHandle different color specifiers #495on Apr 20, 2026
  5. kvid commented on Apr 20, 2026

    @kvid
    Collaborator

    @esromneb - please try my PR #495 that should fix this bug you reported. Feel free to review or otherwise comment that PR too.
    Edit: Others that might read this are of course also welcome.

  6. added a commit that references this issue on Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions