sketch
Version:
Sketch canvas drawing component
51 lines (28 loc) • 718 B
Markdown
# Sketch
Turn a canvas into a sketch pad.

## Installation
```
$ component install component/sketch
```
## API
### sketch(canvas)
Turn the given `canvas` into a sketch pad.
```js
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