How to use the roughjs.svg function in roughjs

To help you get started, we’ve selected a few roughjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github willb335 / chessboardjsx / src / customRough.js View on Github external
export const roughSquare = ({ squareElement, squareWidth }) => {
  let rc = rough.svg(squareElement);
  const chessSquare = rc.rectangle(0, 0, squareWidth, squareWidth, {
    roughness: 0.8,
    fill: '#b58863',
    bowing: 2
  });
  squareElement.appendChild(chessSquare);
};