LinearGradient

Constructor

LinearGradient <id> (double x1, double y1, double x2, double y2, int fill_spread, int fill_coords) { <gradient_stop_list> }

fill_spread:
  • 0 - pad
  • 1 - repeat
  • 2 - reflect
fill_coords:
  • 0 - rendering coordinates
  • 1 - local coordinates

Action

Defines a LinearGradient for the next graphic objects.

Predefined children

x1, y1, x2, y2, spread, coords.

Example


use core
use display
use gui

_main_
Component root {
  Frame f ("myFrame", 0, 0, 400, 400)
  LinearGradient lg (0, 0, 400, 400, 0, 0) {
    GradientStop _(0, 0, 0, 1, 0)
    GradientStop _( 250, 250, 250, 1, 1)
  }
  Rectangle r (100, 100, 200, 200, 0.5, 0.5)
}