Linear gradient fill style

Log-in or register.

Linear gradient fill style

rsrc/linear-fill.png image LINEAR is a fill style that fills a shape with a linear gradient. The pattern is using currently selected foreground and background colors.

The starting and ending points are visualized by control handles and they can be moved in the raster editor. The relative distance to color mapping is controlled by a function defined in the fill style configuration. It is possible to enable automatic repositioning of the control handles according to bounds of the drawn shape.

Scripting interface

LINEAR can be used from scripts and has the following arguments.

  • gradient (optional) - at least two items each consisting of position in range 0-65535 followed by 4 numbers for RGBA channels in range 0-1. First item must be at position 0, last item must be at position 65535 and the sequence must be increasing.
  • mode - "ABSOLUTE", "RELSHAPE" (default) or "RELIMAGE".
  • point1_X, point1_Y, point2_X, point2_X (optional if mode is not ABSOLUTE) - two points defining the gradient start and end points.

Example

DrawTool.SetFillStyle("LINEAR", "0,0,0,0,1,65535,1,1,1,1,ABSOLUTE,0,0,100,100");

Recent comments

user icon Anonymous
I wish there were...
What about ICL files?