# Set gradient

**URL:** <https://forum.inductiveautomation.com/t/set-gradient/3510>\
**Category:** Ignition\
**Created:** [October 27, 2011, 10:23pm UTC](https://forum.inductiveautomation.com/t/set-gradient/3510 "2011-10-27T22:23:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dero](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@Dero](https://forum.inductiveautomation.com/u/Dero)\
**Post date:** [October 27, 2011, 10:23pm UTC](https://forum.inductiveautomation.com/t/set-gradient/3510/1 "2011-10-27T22:23:54Z")

</div>

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

com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint@aefb72

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

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 17, 2011, 5:43pm UTC](https://forum.inductiveautomation.com/t/set-gradient/3510/2 "2011-11-17T17:43:58Z")

</div>

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.
