function applayGrid(svg, canvasData) {
	let curOpacity;
	/** @param {number} opacity */
	function backImg(opacity) {
		if (curOpacity !== opacity) {
			curOpacity = opacity;
			svg.style.backgroundImage = `radial-gradient(rgb(73 80 87 / ${opacity}) 1px, transparent 0)`;
		}
	}

	backImg(0.7);
	svg.style.backgroundSize = `${canvasData.cell}px ${canvasData.cell}px`;

	return function() {
		const size = canvasData.cell * canvasData.scale;

		if (canvasData.scale < 0.5) { backImg(0); } else
		if (canvasData.scale <= 0.9) { backImg(0.3); } else { backImg(0.7); }

		svg.style.backgroundSize = `${size}px ${size}px`;
		svg.style.backgroundPosition = `${canvasData.position.x}px ${canvasData.position.y}px`;
	};
}
@param { SVGSVGElement } svg
@param { import('./canvas-smbl.js').CanvasData } canvasData