blob: 171d4e43b6013f329a41d2d6bdd77b198fed51b4 [file] [log] [blame] [edit]
<!DOCTYPE html>
<html>
<body>
<canvas id="onscreen" width="200" height="200"></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>