rusackas opened a new pull request, #42942:
URL: https://github.com/apache/superset/pull/42942

   Follow-up to #40784.
   
   ### SUMMARY
   
   #40784 replaced the deck.gl legend's colour-tinted glyph swatch with a real
   CSS box whose `background-color`/`border` come from the category colour. That
   colour string is built as `rgba(${v.color?.join(', ')})`, but deck.gl colour
   arrays express alpha as 0-255 while CSS `rgba()` expects the alpha channel as
   0-1. As a result, any category with a semi-transparent colour rendered its
   legend swatch fully opaque instead of translucent.
   
   This normalizes the alpha channel by dividing it by 255 before building the
   `rgba()` string, matching what CSS expects.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable — the bug only affects the alpha channel of the legend swatch
   colour, which isn't visually distinct in a static screenshot without a
   side-by-side transparency comparison against the map layer.
   
   ### TESTING INSTRUCTIONS
   
   1. Configure a deck.gl chart (Polygon/Scatterplot/Arc/Path) with a 
categorical
      colour scheme where the underlying colours include an alpha value less
      than 255 (e.g. via a custom color scheme or opacity control).
   2. Open the chart and check the legend swatches: before this change, swatches
      for semi-transparent colours rendered fully opaque; after this change they
      render with the correct translucency.
   3. Added a unit test in `Legend.test.tsx` asserting the swatch's
      `background-color` divides the input alpha by 255.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to