rough.js

In this example below you will see how to do a rough.js with some HTML / CSS and Javascript

Test generator ...

Thumbnail
This awesome code was written by mikeK, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright mikeK ©
  • HTML
  • CSS
  • JavaScript
    <canvas id="myCanvas"  width="500" height="500"></canvas>

/*Downloaded from https://www.codeseek.co/mikeK/roughjs-RMqZgQ */
    


/*Downloaded from https://www.codeseek.co/mikeK/roughjs-RMqZgQ */
    let roughCanvas = rough.canvas(document.getElementById('myCanvas'));
let generator = roughCanvas.generator;
let rect1 = generator.rectangle(10, 10, 100, 100);
let rect2 = generator.rectangle(10, 120, 100, 100, {fill: 'red'});
roughCanvas.draw(rect1);
roughCanvas.draw(rect2);

Comments