Sg2.9
GradientColor positioning is...
Recent RSS
GradientColor positioning is bottom-up...
From:  Andrey Katanski
Date:  31. October 2010, 10:36

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.

Re: GradientColor positioning is bottom-up...
From:  Jürg Lehni
Date:  24. November 2010, 17:15

Thanks for reporting. I'll look into it before the new release!

Re: GradientColor positioning is bottom-up...
From:  Jürg Lehni
Date:  3. December 2010, 18:31

This should be fixed now in 2.9.070. Please test and report back!

Re: GradientColor positioning is bottom-up...
From:  Andrey Katanski
Date:  13. December 2010, 15:33

Just tested the new 2.9.070 version and it works!

Gradient positioning=Top Down
Bug=Fixed

Thanks!

PS:Thanks for repairing my first post as well:)

Re: GradientColor positioning is bottom-up...
From:  Jürg Lehni
Date:  13. December 2010, 15:51

Great to hear it works for you now. And yes, the code-tag in the forum is very useful and good to know about ;)

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Hexagonal Rasterizer 02.03.14