async function createBackground(url, { dpr = 1, scale = 1 }, backgroundColor) {
  const baseCanvas = await toCanvas(url, { dpr, scale });
  if (!backgroundColor) return baseCanvas;

  const temp = document.createElement("canvas");
  temp.width = baseCanvas.width;
  temp.height = baseCanvas.height;
  const ctx = temp.getContext("2d");

  ctx.fillStyle = backgroundColor;
  ctx.fillRect(0, 0, temp.width, temp.height);
  ctx.drawImage(baseCanvas, 0, 0);

  return temp;
}
Creates a canvas with a background color from an SVG data URL.

@param {string} url - SVG data URL
@param {Object} options
@param {number} [options.dpr=1] - Device pixel ratio
@param {number} [options.scale=1] - Scale multiplier
@param {string} [backgroundColor] - Background color to apply
@returns {Promise<HTMLCanvasElement>} The resulting canvas