Gradient Fills in WinXP - Revisited!

Richard Gaskin ambassador at
Tue Sep 13 13:41:15 EDT 2005

subzero569 wrote:
> I have exhaustively searched the archived posts for information on gradient 
> fills. A few posts made references to creating a gradient fill via 
> scripting. I am a novice Rev programmer and do not claim to be a 
> mathematician so I am having a tough time with this problem.
> Basically, I have a rectangle graphic generated with a red fill. I want to 
> change this solid fill from plain red to a gradient of Red to Orange. 
> Example: Bottom color of rectangle would be an RGB value of Red: 255,0,0 and 
> the top color would end with Orange: 255,128,0. Is there a way to possibly 
> make the gradient fill in this rectangle using Rev to generate the graphic 
> rectangle? Also, this will only be used on WinXP and images aren't an option 
> at the present time for creating gradient fills.
> As always, I appreciate the assistance I receive from the group. Someday in 
> the near future I will graduate from asking questions to answering questions 
> in this forum.

There's a gradient tool in devolution:

Images are perhaps the only way to make a gradient dynamically, as 
you'll need to modify the image data directly to do it.

The method used in devo is fairly efficient, taking advantage of the 
ability to "stretch" an image:  it only generates a gradient that's 16 
pixels wide, so when stretched horizontally it maintains the same 
appearance but contains only a small amount of image data.  The gradient 
tool in devo also makes vertical gradients.

To use, select an image object, open the gradient tool, and adjust the 
sliders.  Double-clicking on either of the slider handles will bring up 
the OS GetColor dialog to select the colors.  The tool updates the image 
immediately after option -- one of the advantages of using the "stretch" 
method is that it not only takes less RAM, but is also pretty quick. :)

  Richard Gaskin
  Fourth World Media Corporation
  Rev tools and more:

More information about the Use-livecode mailing list