Gradient along a graphic line

Scott Rossi scott at tactilemedia.com
Fri Dec 31 16:32:23 EST 2010


There's a strokeGradient that applies gradients to lines of objects, just like the fillGradient.  When you say "looping line" do you mean something besides an oval?  You can apply different gradient colors by setting color stops within the gradient -- you can't use the points of the line directly, but if the line is an oval shape or thereabouts, you can use a radial strokeGradient and set color stops that roughly correspond to the point locations of the line.

If the line is straight, you could calculate each point as percentage of overall distance and set the gradient's color stops appropriately.  If the line appears at an angle, you may want to match the angle of the gradient to the line's angle.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design

On Dec 31, 2010, at 11:41 AM, Nonsanity <rev at nonsanity.com> wrote:

> Anyone know a way to set the points along a graphic line to different
> colors, or to apply a gradient along the length of a line, regardless of its
> path?
> 
> I want to have one end of a looping line one color, and the other end
> another, with a smooth blend between them.
> 
> Only way I can think of doing it is breaking the one grc down into a
> bajillion others (one for each point pair in "the points of grc x") and set
> a linear gradient for each at the right segment of the overall gradient and
> at the right angle. A heck of a lot of work.
> 
> A gradient stroke option of "Path" would be sweet, but is the a current
> solution?
> 
> ~ Chris Innanen
> ~ Nonsanity
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 





More information about the Use-livecode mailing list