Generated Object



This node takes the attributes of the javafx.scene.paint.RadialGradient class. see javafx.scene.paint.RadialGradient

In addition, it takes the following attributes:

center - a list of 2 elements with the first value used to set the centerX attribute of the LinearGradient and the second value to set the centerY attribute.

stops - The value of the stops attribute should be a List of 2-element Lists containing an offset and color: [[0.0, black], [1.0, red]]


This node may optionally take one or more stop nodes as content. see Scenegraph.stop


This node creates a radial gradient paint.


import groovyx.javafx.GroovyFX;
import groovyx.javafx.SceneGraphBuilder

    def sg = new SceneGraphBuilder();

    sg.stage(title: "Gradient Example (GroovyFX)", width: 1020, height: 450, visible: true) {
        scene(fill: linearGradient(endX: 0, stops: [[0.0, white], [1.0, lightgray]])) {

            def width = 240
            def height = 180

            circle(radius: height / 2) {
                    radialGradient(radius: 0.85, center:[0.5, 1], stops:[[0, magenta], [0.75, indigo]])