<canvas width="600" height="400"></canvas>
<script>
var tela = document.querySelector('canvas');
var pincel = tela.getContext('2d');
pincel.fillStyle = 'lightgray';
pincel.fillRect(0,0,600,400);
function circulo(x,y,cor) {
pincel.fillStyle = cor
pincel.beginPath();
pincel.arc(x,y,10,0,2*3.14);
pincel.fill();
}
function desenhaFlor(x,y) {
circulo(x,y,'red');
circulo(x-20,y,'orange');
circulo(x,y-20,'yellow');
circulo(x+20,y,'black');
circulo(x,y+20,'blue');
}
desenhaFlor(300,200);
desenhaFlor(50,100);
desenhaFlor(400,50);
</script>