Section 25.21. CanvasRenderingContext2D.createRadialGradient( ): create a radial color gradient


25.21. CanvasRenderingContext2D.createRadialGradient( ): create a radial color gradient

25.21.1. Synopsis

 CanvasGradient createRadialGradient(float xStart, float yStart, float radiusStart,                                     float xEnd, float yEnd, float radiusEnd) 

25.21.1.1. Arguments

xStart, yStart

The coordinates of the center of the starting circle.


radiusStart

The radius of the starting circle.


xEnd, yEnd

The coordinates of the center of the ending circle.


radiusEnd

The radius of the ending circle.

25.21.1.2. Returns

A CanvasGradient object representing a radial color gradient.

25.21.2. Description

This method creates and returns a new CanvasGradient object that radially interpolates colors between the circumferences of the two specified circles. Note that this method does not specify any colors for the gradient. Use the addColorStop( ) method of the returned object to do that. To stroke lines or fill areas using a gradient, assign a CanvasGradient object to the strokeStyle or fillStyle properties.

Radial gradients are rendered by using the color at offset 0 for the circumference of the first circle, the color at offset 1 for the second circle, and interpolated color values (red, green, blue, and alpha) at circles between the two.

25.21.3. See Also

CanvasGradient.addColorStop( ), CanvasRenderingContext2D.createLinearGradient( )




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net