Drawing different colored shapes in a path (HTML5 Canvas / Javascript)

前端 未结 2 2123
情话喂你
情话喂你 2021-02-18 13:12

I\'m trying to draw multiple circle arcs filled with different colors

        //-------------- draw
        ctx.beginPath();
        ctx.fillStyle = \"black\";
          


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-18 13:49

    Close the path and then reopen it.

    ctx.closePath();
    ctx.beginPath();
    

    jsFiddle.

    ...between the arc drawing code.

    Circles

提交回复
热议问题