-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprograma.html
More file actions
36 lines (27 loc) · 735 Bytes
/
programa.html
File metadata and controls
36 lines (27 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<canvas width="900" height="400"></canvas>
<script>
var tela = document.querySelector('canvas');
var pincel = tela.getContext('2d');
pincel.fillStyle = 'blue';
pincel.fillRect(0, 0, 900, 400);
pincel.fillStyle = 'red';
pincel.fillRect(0, 0, 300, 400);
pincel.fillStyle = 'white';
pincel.fillRect(300, 0, 300, 400);
pincel.fillStyle = 'yellow';
pincel.beginPath();
pincel.moveTo(450, 200);
pincel.lineTo(300, 400);
pincel.lineTo(600, 400);
pincel.fill();
pincel.fillStyle = 'yellow';
pincel.beginPath();
pincel.moveTo(450, 200);
pincel.lineTo(300, 0);
pincel.lineTo(600, 0);
pincel.fill();
pincel.fillStyle = 'green';
pincel.beginPath();
pincel.arc(450, 200, 100, 0, 2 * 3.14);
pincel.fill();
</script>