Set gradient

I have created some shapes with custom gradient fills.
I want to change the fill with different colors for different events.
The effect would be similar to the tint method for a bitmap but with the resolution independence of vectors.
I also dont want to have to use visibility on stacked shapes for this.
Creating a matching shape with reduced opacity stacked on top of the original shape and changing the fill color would almost work but it doesnt give you full saturation of the color … Red is just Pink.

this script

x = event.source.parent.getComponent(‘Rectangle’).fillPaint
print x

prints the following


This script

event.source.parent.getComponent(‘Rectangle’).fillPaint = event.source.parent.getComponent(‘Rectangle1’).fillPaint

copies the gradient fill from one rectangle to another.

how can I write the gradient to the shape at event time from a Global constant dictionary

There is currently no way to dynamically create the gradients used by shapes. I’ve added a feature request ticket to get this implemented, I’ll post back here when it gets done.