We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
PDF Gradients (Read 2616 times)
PDF Gradients
Sep 29th, 2006, 7:13am
 
I need gradient line colours for a project I'm working on and am willing to devote some time to implementing the feature if it is of a reasonable scope and complexity. Can someone please offer some pointers on what would be involved in implementing this feature?

(Some time ago I filed a bug on this, but am now unable to find it.)

Thanks...
Re: PDF Gradients
Reply #1 - Sep 30th, 2006, 12:26am
 
http://dev.processing.org/bugs/show_bug.cgi?id=371
Re: PDF Gradients
Reply #2 - Oct 3rd, 2006, 3:09pm
 
I added support for gradient colours on lines when using the Java2D and PDF renderers. It only supports the simplest case of lines created using:

Code:
beginShape(LINES);
stroke(startColor);
vertex(x0, y0);
stroke(endColor):
vertex(x1, y1);
endShape();


More general cases are harder (and luckily I don't need them for the project I'm working on). Applying gradients to the strokes on other shapes, or to their fills is difficult because Java2D has no way of defining vertex colours. Extending such support through to the PDF renderer would also be more involved.

So, if anyone wants this feature in its current limited form, or if it should be added back into the library, contact me for the code. It was only a few lines added to PGraphicsJava2D.java.
Re: PDF Gradients
Reply #3 - Mar 25th, 2007, 2:15am
 
I'm restarting work on this project, so I'm incorporating my modifications into my pull of the latest trunk code.

I noticed the inclusion of new members in PGraphicsJava2D: fillGradient, fillGradientObject, strokeGradient and strokeGradientObject.

Is there a plan to add fill and stroke gradients soon?

Thanks.
Page Index Toggle Pages: 1