HTML5 Canvas Set Fill with KineticJS

To fill a shape with KineticJS, we can set the fill property when we instantiate a shape, or we can use the setFill() method.  KineticJS supports colors, patterns, linear gradients, and radial gradients.

Instructions: Mouseover each pentagon to change its fill.  You can also drag and drop the shapes.

Open in new window

Code Editor

Modified on April 9th, 2013 by Eric Rowell
comments powered by Disqus