Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support connected handles with multiple colors #2906

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
4 checks passed
@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