1850727-1.html (417B)
1 <!DOCTYPE html> 2 <html> 3 <body> 4 <canvas id="c" width="200" height="200"></canvas> 5 6 <script> 7 const c = document.getElementById("c"); 8 const ctx = c.getContext("2d"); 9 10 ctx.translate(20, 20); 11 12 ctx.beginPath(); 13 ctx.arc(0, 0, 15, 0, 2 * Math.PI); 14 ctx.clip(); 15 16 ctx.beginPath(); 17 ctx.arc(0, 0, 10, 0, 2 * Math.PI); 18 ctx.lineWidth = 2; 19 ctx.globalAlpha = 0.5; 20 ctx.strokeStyle = '#00ff00'; 21 ctx.stroke(); 22 23 </script> 24 25 </body> 26 </html>