Hello,
First of all thank you for the great Plug-In!
I'm new to scriptographer and scripting in general, so I may be wrong about this bug:)
I think that the GradientColor is using the old bottom-up coordinate system.
I took this example from the Reference and just changed the coordinates of the circle and the gradient:
// a radial gradient from white to black
var gradient = new Gradient() {
type: 'radial',
stops:
[
new GradientStop(new GrayColor(0), 0),
new GradientStop(new GrayColor(1), 1)
]
};
var origin = new Point(100, 100);
var destination = new Point(200, 100);
var gradientColor = new GradientColor(gradient, origin, destination);
// create a circle filled with the gradient color
var circle = new Path.Circle(new Point(100, 100), 100) {
fillColor: gradientColor
};
But the result is the one in picture Circle_01.
In order to work I modified the script so the Y value of the gradient origin and destination is negative:
// a radial gradient from white to black
var gradient = new Gradient() {
type: 'radial',
stops:
[
new GradientStop(new GrayColor(0), 0),
new GradientStop(new GrayColor(1), 1)
]
};
var origin = new Point(100, -100);
var destination = new Point(200, -100);
var gradientColor = new GradientColor(gradient, origin, destination);
// create a circle filled with the gradient color
var circle = new Path.Circle(new Point(100, 100), 100) {
fillColor: gradientColor
};
The result is in picture Circle_02.