Does it work correctly for a linear gradient, but not for a radial one?

- Gordon


-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Trey Long
Sent: Monday, February 06, 2006 2:19 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Gradient Fill question

So no one has used any gradients? Or had any problems with the ratio 
attributes?

Trey Long wrote:
> My question is about the RATIO attribute of the 
> Graphics.beginGradientFill() method.
> 
> Example:
>
graphics.beginGradientFill(GradientType.RADIAL,[0x0000FF,0x00F9FF],[.27,
1],[0,255]);
> graphics.drawCircle(0,0,size);
> graphics.endFill();
> 
> Now, if my understanding is correct, a Ratio attribute of [0,255] will

> basically set one color to the outside edge of my circle and the other

> color will occur at the direct center. In other words, the entire 
> gradient will be shown.
> 
> What I am getting is the first color pushes the second color way out
of 
> the circle, not even showing it.
> 
> Are the docs wrong? Is this not a ratio? Am I stupid? The answer to
the 
> last question is probably yes, but any help will be great.
> 
> Excerpt from API docs:
> 
>       |*ratios*:Array 
> <http://livedocs.macromedia.com/labs/1/flex/langref/Array.html>| - An 
> array of color distribution ratios; valid values are 0 to 255. This 
> value defines the percentage of the width where the color is sampled
at 
> 100%. Specify a value for each value in the |colors| parameter.
> 
> For example, for a linear gradient that includes two colors, blue and 
> green, the following figure illustrates the placement of the colors in

> the gradient based on different values in the |ratios| array:
> 
> |ratios|      Gradient
> |[0, 127]|    
> |[0, 255]|    
> |[127, 255]|  
> 
> 


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to