Creates a linear gradient of many colors.
Requires graphicsbuilder-ext-jdk6 and Java6+.
Properties
Property |
Default |
Notes |
|---|---|---|
x1 |
|
|
y1 |
|
|
x2 |
|
|
y2 |
|
|
cycle |
|
value must be any of ['nocycle','reflect','repeat] or any MultipleGradientPaint.CycleMethod |
stretch |
|
Scales the gradient to fit the Shape's bounds |
fit |
|
Scales the gradient retaining the aspect ratio |
stops |
|
must define at least two stops |
linkTo |
|
a reference to a linearGradient or a radialGradient |
If linkTo is used, then this gradient will reuse the referenced one's stops, new stops may be added to this gradient though.
Stops
Property |
Default |
Notes |
|---|---|---|
offset |
|
a float value in the range [0..1] |
color |
|
a Color or a color string |
Example
4 rectangles, each one with a diagonal gradient

Different settings for fit, stretch and cycle
|
|
|
|
|
|