Open birkskyum opened 4 weeks ago
I'm in this space at the moment.
I currently use a mix of D3's color, scale and interpolation tools to transition things in a requestAnimationFrame function. I'm doing this because I (maybe falsely) assumed there was no paint expression support for color.
Is there something in the works for color transformation that I haven't stumbled on? Maybe I can help out here or elsewhere.
Got it. Thanks @birkskyum . Think I'll have a little look. Fixing this will definitely help what I'm working on.
Repro here: https://codepen.io/birkskyum-1471370946/pen/NWQzdZG
changing the color will be instant on 1-2 first clicks, despite a
"fill-color-transition": { "duration": 2000 },
This issue go away by replacing the fill-color expression:
"fill-color": ["match",["get","ADM0_A3"],["ATA","GRL"],"#FFFFFF","#EAB38F"]
With a string color:
"fill-color": "green"
Demo
The video show that the first time i click on the expression fill-color, the transition is instant, and then it's normal for subsequent clicks.
Changing the fill-color to "green" makes the first clock behave as expected as well
https://github.com/user-attachments/assets/49154673-ab3b-4b0a-8d00-eafb5fc509cc