All html canvas shapes are given the color of the last object added
问题 I was trying to do an Olympic type flag, purely as a way of learning how to draw in JavaScript. This should draw two circles - one blue, one black... Here is the code (which I apologise for, been moving things between the two functions - Not sure how to refer to the context non-explicitly): function drawCircle(ctx,x,y,radius, color){ var startAngle = 0; var endAngle = (Math.PI*2); var clockwise = true; ctx.fillStyle = color; ctx.arc(x,y,radius,startAngle,endAngle, clockwise); ctx.fill(); ctx