mirror of
https://github.com/rough-stuff/rough.git
synced 2026-01-14 17:07:58 -05:00
498ebfa1804d4ff6d4599e9870135fd98cdd697b
Rough.js
Rough.js is a light weight, stand-alone Canvas based library that lets you draw in a sketchy, hand-drawn-like, style. The library defines primitives to draw lines, curves, arcs, polygons, circles, and ellipses. It also supports drawing SVG paths.
Install
The latest Rough.js can be downloaded from the dist folder.
or from npm:
npm install --save roughjs
Usage
const rough = new RoughCanvas(document.getElementById('canvas'), 800, 800);
rough.rectangle(5, 5, 90, 90);
rough.circle(80, 170, 50);
rough.ellipse(300, 100, 150, 80);
rough.line(80, 170, 300, 100);
and check out more examples at roughjs.com.
API & Documentation
Check out the website: roughjs.com
and
Credits
This project was inspired by Handy, a java based library for Processing. Rough.js borrows some core algorithms from Handy, but it is not a JS port for processing.js.
License
Languages
HTML
57%
TypeScript
42.3%
JavaScript
0.7%
