Gradient along a graphic line

Nonsanity rev at nonsanity.com
Fri Dec 31 17:34:12 EST 2010


The line is like a hand-drawn line. It can be any shape, including looping
and crossing itself. I'd like to be able to have it fade between colors
along its length.

For now I've broken it into several pieces and colored them separately. It's
not as perfect a solution as I'd like, but it'll do for now.

It would be nice to be able to "set the vertexcolors of grc 1" with a list
of RGB colors, just as you set the points of a grc to a list of x,y coords.
For the future perhaps...

 ~ Chris Innanen
 ~ Nonsanity


On Fri, Dec 31, 2010 at 4:32 PM, Scott Rossi <scott at tactilemedia.com> wrote:

> 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
> >
>
>
> _______________________________________________
> 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