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