User Guide
Ruby Component
translateTransform x, y
scaleTransform sf-x, sf-y
resetTransform
The rotation method takes an angle in Degrees. The translate method takes x and y offsets. The scale method takes x and y scale factors –
these are floats with 1.0 meaning no change. The resetTransform method does exactly what it says, it resets any applied transforms.
The example below shows a gradient that has been stretched and translated.
Blending
You don't just have to have a straight gradient. Using the setBlendTriangularShape and the setBlendBellShape methods you can move
the end 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
Both methods take two inputs. The first is the focus. This is a float between 0 and 1 which defines the relative distance of the end point
colour from the start point. A value of 0.5 would put it bang in the middle for example. The second parameter is the scale. This is also a float
between 0 and 1 and it defines the intensity of the colour at the focus point.
Here's an example of these in action:
You take this a step further and set your own blend points. This is done using the setBlend method.
setBlend blendArray
The method takes an array of two element arrays. Each two element array defines first a blend factor then a position along the gradient. Both
values are floats in the range 0 to 1.
130 of 212