Changing color opacity in state machine while color is bounded to the data input

I faced the task to change the opacity of the color of layout background that is blinded to the data inputs. The final result should look like this: button that i can click and the fill goes away and stroke appears, also the size of the layout is adaptive and i can change the color of the animated elements:

1.mp4

For this example i changed design of the initial button.

First of all i bound the color property to the data color input. This input controls all the color properties, including the opacity. So i couldn’t animate the opacity property or bind that to different number input:

2.mp4


Changing the opacity of all layout isn’t what i wanted:

3.mp4


So i found a solution! Instead of solid fill i used gradient fill. I bound the points of the gradient to the color input. That way i’ve get the ability to animate the opacity of all the fill, while it could be changed with the help of data color input:

2025-11-16 18-24-11.mp4


A bit overcomplicated, but that works! Hope if i helped someone