User Guide

Ruby Component
Wrapping
In a similar way to the LinearGradientBrush a PathGradientBrush has a bounding rectangle which contains the whole path. This makes the
brush into a tile. The tile can then be used repeatedly to pave any area that is painted with the brush.
Unlike the LinearGradientBrush, the default for the PathGradientBrush is to not tile or clamp. You can change this by setting the wrap mode
using the setWrapMode method.
setWrapMode mode
The various mode options allow you to flip the tiles as they are placed so that the tiles blend into one another. Here are the options for the
mode input value:
0 or “tile” Normal tiling is performed
1 or “flipx” Tiling is performed with alternate tiles flipped in the x direction
2 or “flipy” Tiling is performed with alternate tiles flipped in the y direction
3 or “flipxy” Tiling is performed with alternate tiles flipped in the x and y directions
4 or “clamp” or “notile” No tiling is performed – this is the default option
The example below shows the “flipx” wrap mode in action. You can see how the tiles in the x direction are alternately flipped but the tiles in
the vertical direction are not.
Blending
The PathGradientBrush supports blending just like the LinearGradientBrush. Using the setBlendTriangularShape and the
setBlendBellShape methods you can move the centre colour to some in between point and blend out on either side. The bell option uses a
non-linear blending curve.
setBlendTriangularShape focus, scale
setBlendBellShape focus, scale
133 of 212