Turn a canvas into a sketch pad
JavaScript CSS
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.npmignore
History.md
Makefile
Readme.md
component.json
example.html
index.js
package.json
path.js
point.js
sketch.css

Readme.md

Sketch

Turn a canvas into a sketch pad.

js canvas sketch

Installation

$ component install component/sketch

API

sketch(canvas)

Turn the given canvas into a sketch pad.

var sketch = require('sketch');
sketch(canvas);

Sketch#add(object)

Add drawable object that must provide a .draw(ctx) method.

Sketch#size(n)

Set pen size.

Sketch#color(string)

Set pen color.

Sketch#opacity(n)

Set pen opacity.

Sketch#clear()

Clear the objects and re-draw.

Sketch#reset()

Reset the sketch defaults and clear the canvas.

License

MIT