Section 25.9. CanvasGradient.addColorStop( ): add a change of color at some point in the gradient


25.9. CanvasGradient.addColorStop( ): add a change of color at some point in the gradient

25.9.1. Synopsis

 void addColorStop(float offset, String color) 

25.9.1.1. Arguments

offset

A floating-point value in the range 0.0 to 1.0 that represents a fraction between the start and end points of the gradient. An offset of 0 corresponds to the start point, and an offset of 1 corresponds to the end point.


color

Specifies the color to be displayed at the specified offset, as a CSS color string. Colors at other points along the gradient are interpolated based on this and any other color stops.

25.9.2. Description

addColorStop( ) provides the mechanism for describing color changes in a gradient. This method may be called one or more times to change the color at particular percentages between the gradient's start and end points.

If this method is never called on a gradient, the gradient is transparent. At least one color stop must be specified to produce a visible color gradient.




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