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

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
     This PR adds comprehensive support for 8-digit hex colors (with alpha 
channel) in Superset's theme system and color utilities. This enables custom
   themes to use colors like #FF000080 without breaking existing functionality.
   
    Problem Solved
   
     - Issue: Color utilities failed when custom themes provided 8-digit hex 
values
     - Root Cause: getContrastingColor() incorrectly treated 8-digit hex as RGB 
format
     - Impact: emotion-rgba library incompatible with 8-digit hex colors in 
components
   
    Changes Made
   
     Color Utilities Enhanced (packages/superset-ui-core/src/color/utils.ts)
   
     - getContrastingColor(): Fixed logic to properly detect RGB vs hex 
formats, handles 8-digit hex by ignoring alpha channel
     - hexToRgb(): Added support for 8-digit hex conversion (ignores alpha for 
RGB output)
     - addAlpha(): Enhanced to replace existing alpha channel instead of 
appending
   
     Component Fixes
   
     - ActionButtons: Replaced emotion-rgba with addAlpha for gradient 
backgrounds
     - BuilderComponentPane: Replaced emotion-rgba with addAlpha for box shadows
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
    Manual Testing:
     1. Create a custom theme with 8-digit hex colors:
     {
       "colorPrimary": "#FF000080",
       "colorBgLayout": "#FFFFFF40",
       "colorBorder": "#00000020"
     }
     2. Apply the custom theme and verify:
       - Dashboard FilterBar renders without console errors
       - Dashboard builder components render correctly
       - Color contrasting still works for text readability
       - No visual regressions in existing themes
       
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] 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
   


-- 
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