/pGraphicsX

Graphics extension conceived to implement a class of gradients for the Processing API

OtherNOASSERTION

PGraphicsX

The main purpose of this library is to define a PGradient interface with implementations LinearGradient and RadialGradient, as well as an extension to the PGraphics class, called PGraphicsX, which is capable of using the new gradient type in all fundamental rendering methods ( e.g. fill(), stroke(), line(), rect(), arc(), curve(), etc.). The API for these gradients will be very simple, requiring only a constructor and a method for defining the relative positions and color values of a sequence of stops within the gradient (i.e. addColorStop(), following the model used by HTML5 Canvas). An optional additional method could be used to remove stops that were previously defined. PGraphicsX would provide new implementations of the methods that set, draw, and render using color values (of type color), so that they can alternatively make use of gradient values (of type PGradient) if the user has specified such a value (with fill() or stroke()). The boundaries of the gradient can either be defined with absolute units of pixels or with relative normalized units (0.0 - 1.0), whichever is preferred by the user ( following the model used by SVG).