Scripting gradients

John Allijn jallijn at gmail.com
Wed Sep 5 05:19:56 EDT 2012


Thanks!



On Sep 5, 2012, at 11:00, Scott Rossi <scott at tactilemedia.com> wrote:

> Sorry, make that:
> 
> put theArray["ramp"] into theVar   (no object reference needed)
> 
> 
> Recently, I wrote:
> 
>> Gradient settings are stored in an array property called the fillGradient.
>> The color data is stored the "ramp" index.  So to get the colors, you could
>> script something like:
>> put the fillGradient of graphic "myBox" into theArray
>> put theArray["ramp"] of graphic "myBox" into theVar
>> 
>> The variable theVar will contain each color of the gradient, listed one per
>> line.
>> 
>> After making changes to the colors, you load the color data back into the
>> array, and set the fillGradient of the graphic to the array:
>> put theVar into theArray["ramp"]
>> set the fillGradient of graphic "myBox" to theArray
>> 
>> See the fillGradient entry in the dictionary for more info.
>> 
>> Regards,
>> 
>> Scott Rossi
>> Creative Director
>> Tactile Media, UX Design
>> 
>> 
>> 
>> Recently, John Allijn wrote:
>> 
>>> Hi,
>>> I have a rectangle that I filled with a gradient in the inspector.
>>> Is there a way to script the colors of this gradient?
>>> I want to let the user pick a color for a color theme and have the gradient
>>> match that.
>>> Thanks!
>>> 
>>> 
>>> _______________________________________________
>>> 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
>> 
> 
> 
> Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX Design
> 
> 
> 
> _______________________________________________
> 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