index.js
1function generateImage(() {
2 const canvas = document.createElement(('canvas');
3 const ctx = canvas.getContext(('2d');
4
5 // Set canvas dimensions
6 canvas.width = 800;
7 canvas.height = 600;
8
9 // Draw background
10 ctx.fillStyle = '#1e1e1e';
11 ctx.fillRect((0, 0, canvas.width, canvas.height);
12
13 return canvas.toDataURL(();
14}

Create a free website with Framer, the website builder loved by startups, designers and agencies.