radialGradient()
Produces a SVG "radialGradient"
element.
Syntax
radialgradient(
id STRING,
cx STRING,
cy STRING,
fx STRING,
fy STRING,
r STRING,
spreadMethod STRING,
gradientTransform STRING,
gradientUnits STRING )
RETURNS om.DomNode
- id is the SVG object identifier.
- cx defines the X coordinate of the radial gradient center.
- cy defines the Y coordinate of the radial gradient center.
- fx defines the X coordinate of the radial gradient focal point.
- fy defines the Y coordinate of the radial gradient focal point.
- spreadMethod defines how the gradient is spread out through the shape.
- gradientTransform defines the gradient transformation.
- gradientUnits defines the coordinate system to be used.
Usage
This function creates a "radialGradient"
SVG DOM element from the
parameters.
A SVG "radialGradient"
element can be used to define fill colors of shapes.
The element must contain "stop"
elements that can be created with the stop
function.
The resulting gradient definition can be added to a "defs"
SVG element.
Example
DEFINE root_svg, defs, rg om.DomNode
...
LET defs = fglsvgcanvas.defs( NULL )
CALL root_svg.appendChild( defs )
LET rg = fglsvgcanvas.radialGradient( "gradient_1",
NULL, NULL, "5%", "5%", "65%",
"pad", NULL, NULL )
CALL rg.appendChild( fglsvgcanvas.stop( "0%", "gray", 0.4 ) )
CALL rg.appendChild( fglsvgcanvas.stop( "100%", "navy", 0.7 ) )
CALL defs.appendChild( rg )