Syntax for gradient fill option in 3.10

Discussion about recent product features & solutions!
6 posts • Page 1 of 1
aorange
Posts:147
Joined: Thu Nov 04, 2010 10:07 am

Syntax for gradient fill option in 3.10

Post by aorange »

Hi guys,

I just thought that I would ask what the syntax is for the gradient fill option that was shown at the user days in Ravenna. This would be very useful to eliminate the need of having to use PNG files to achieve the same effect.

Many thanks

Jonathan

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Syntax for gradient fill option in 3.10

Post by mkoller »

Here it is:

[gradient,[...spec...]]

spec := type "," [spread ","] gradSpec ("," colorPos "," color )*
type := "conical" | "linear" | "radial"
spread := "pad" | "repeat" | "reflect"
colorPos := float value 0.0 .. 1.0
color := any static PVSS color

gradSpec := conicalSpec(has no spread) | linearSpec | radialSpec

conicalSpec := centerX "," centerY "," angle
x,y 0.0 .. 1.0 (bounding Box)
angle 0.0 .. 360.0

linearSpec := startX "," startY "," stopX "," stopY
startX etc := 0.0 .. 1.0 (0,0 = top left corner of bounding box, 1,1 = bottom right)

radialSpec := centerX "," centerY "," focalX "," focalY "," radius
all values 0.0 .. 1.0 (bounding Box)


So a very basic linear gradient from 0,0 to 1,1 changing color from black to white would be:
"[gradient,[linear,pad,0.0,0.0,1.0,1.0,0.0,{0,0,0},1.0,{255,255,255}]]"

aorange
Posts:147
Joined: Thu Nov 04, 2010 10:07 am

Re: Syntax for gradient fill option in 3.10

Post by aorange »

Excellent, thank you very much!

aorange
Posts:147
Joined: Thu Nov 04, 2010 10:07 am

Re: Syntax for gradient fill option in 3.10

Post by aorange »

Could you please post an example using the radial fill, I cannot seem to get it to work :(

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Syntax for gradient fill option in 3.10

Post by mkoller »

Here's the example for a radial fill, green to white:
"[gradient,[radial,reflect,0.0,0.0,0.0,0.0,0.7,0.0,{0,255,0},1.0,{255,255,255}]]"

and a conical with some blue colors:
"[gradient,[conical,0.4,0.3,60.,0.0,{89,66,240},0.7,{149,202,255,175},0.8,{86,66,240}]]"

You can see the result in the attached screenshot. Image
Attachments
gradients.png

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Syntax for gradient fill option in 3.10

Post by mkoller »

Here's the example for a radial fill, green to white:
"[gradient,[radial,reflect,0.0,0.0,0.0,0.0,0.7,0.0,{0,255,0},1.0,{255,255,255}]]"

and a conical with some blue colors:
"[gradient,[conical,0.4,0.3,60.,0.0,{89,66,240},0.7,{149,202,255,175},0.8,{86,66,240}]]"

You can see the result in the attached screenshot. Image
Attachments
gradients-20110517.png

6 posts • Page 1 of 1