Expand my Community achievements bar.

SOLVED

Script for Linear Gradient Fill

Avatar

Level 9

I need a script to gradient fill - linear top to bottom - rectangles. Can someone help me with this?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

You may need to create the linear elements first if they have not been defined at design time,  there is a sample of doing that here, http://forms.stefcameron.com/2008/03/14/field-background-color-fill/#comment-4423

Regards

Bruce

View solution in original post

6 Replies

Avatar

Level 10

there's already linear top to bottom, in the border palette, go under style and change the style to: Linear - to bottom

for a rectable object, it's in the object palette at Fill

Avatar

Level 9

Thanks for your reply.

I am aware that there is a setting for this but I need a script so the colors can change based on user interaction with the form. I need a way to script the gradient colors.

Avatar

Level 9

Robert,

Your script above does not work. To make a rectangle or textfield, linear to bottom, gradient filled would require two colors, not just one. I need a script to do this to a rectangle and a dropdown field.

Avatar

Correct answer by
Level 10

Hi,

You may need to create the linear elements first if they have not been defined at design time,  there is a sample of doing that here, http://forms.stefcameron.com/2008/03/14/field-background-color-fill/#comment-4423

Regards

Bruce