GitHub user aldotoa created a discussion: Dynamic text colour based on 
background colour

I was trying out the new conditional formatting colours in Superset v6 but I'm 
having trouble reading the numbers over the background if the gradient is 
darker.

<img width="384" height="293" alt="Screenshot 2026-02-21 at 19 01 10" 
src="https://github.com/user-attachments/assets/647d9b9d-25ee-417f-b7e9-8f90ccfe47bb";
 />

I saw on youtube that there's a luminance formula that calculates the 
"lightness" of a colour. Here it is being implemented in Swift:
https://www.youtube.com/shorts/nlJpnLkLymw

I'm thinking it should work on both light and dark mode, regardless what is the 
background colour - text will always choose the correct colour based on the 
formula.

GitHub link: https://github.com/apache/superset/discussions/38160

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


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

Reply via email to