Skip to content

Instantly share code, notes, and snippets.

View ammarahm-ed's full-sized avatar
❤️

Ammar Ahmed ammarahm-ed

❤️
View GitHub Profile
@danielpquinn
danielpquinn / svg-rounded-rectangle-path.js
Last active April 20, 2024 13:04
Draw SVG Rounded Rectangle Path
/**
* Get path data for a rounded rectangle. Allows for different radius on each corner.
* @param {Number} w Width of rounded rectangle
* @param {Number} h Height of rounded rectangle
* @param {Number} tlr Top left corner radius
* @param {Number} trr Top right corner radius
* @param {Number} brr Bottom right corner radius
* @param {Number} blr Bottom left corner radius
* @return {String} Rounded rectangle SVG path data
*/