blob: 87dc7654b4975f035e7da0464dc70ef9f4dc3006 [file] [edit]
<!DOCTYPE html>
<html>
<body>
<canvas id="onscreen" width="200" height="200" style="border: 1px solid black;"></canvas>
<script>
const canvas = document.getElementById('onscreen');
const context = canvas.getContext('2d');
const square = new Path2D();
square.rect(50, 50, 100, 100);
context.fillStyle = 'green';
context.fill(square);
</script>
</body>
</html>