javafx.scene.paint.Stop used in conjunction with Linear and Radial Gradients
This node takes the attributes of the javafx.scene.paint.Stop class. see javafx.scene.paint.Stop
Specifically:
offset - number ranging from 0 to 1 to indicate where the gradient stop should be placed
color - The color of the gradient at this offset. The default is black.
This node does not take content
This node creates a gradient stop.
import groovyx.javafx.GroovyFX;
import groovyx.javafx.SceneGraphBuilder
GroovyFX.start({
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]) {
stop(offset: 0, color: magenta)
stop(offset: 0.75, color: indigo)
}
}
}
});
|