Skip to content

Support connected handles with multiple colors#2906

Merged
joeyballentine merged 1 commit intochaiNNer-org:mainfrom
RunDevelopment:multiple-connected-handle-colors
May 23, 2024
Merged

Support connected handles with multiple colors#2906
joeyballentine merged 1 commit intochaiNNer-org:mainfrom
RunDevelopment:multiple-connected-handle-colors

Conversation

@RunDevelopment
Copy link
Member

This PR adds support for connected handles with multiple colors.

image
image

The styling is done is an overly complex way, but it was the only good solution I found. I'm using the same conic gradient we use for non-connected handles, and an SVG background image is used to create the hole in the middle.

Why an SVG background image? Because nothing else worked as well.

  • I first tried to just use border color, but this looked horrible. The colors were rotated compared to non-connected handles, 3 colors looked horrible, and >=5 colors weren't supported at all.
  • I tried using a radial gradient on top of the conic gradient to make the hole. This worked, but didn't have antialiasing. It looked horribly jagged when zoomed out.

Other changes:

  • Cache as much as possible in getTypeAccentColors.
  • Fixed a bug with collapsed handles that made them white when the handle had multiple colors.
  • Fixed a bug with connected input handles that caused them to use the colors of their definition type when the color of the incoming edge was the default color.

@joeyballentine joeyballentine merged commit ec975ca into chaiNNer-org:main May 23, 2024
@RunDevelopment RunDevelopment deleted the multiple-connected-handle-colors branch May 23, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants