代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>笑脸</title>
<style>
#root {
display: block;
margin: 100px auto;
}
</style>
</head>
<body>
<canvas id="root" width="600px" height="500px"></canvas>
<script>
let container = document.querySelector('#root');
let ctx = container.getContext("2d");
drawArc(150, 180, 100, 0, 2, '#e1a51d'); //脸
drawArc(80, 110, 30, 0, 2, '#333333'); //左眼
drawArc(220, 110, 30, 0, 2, '#333333'); //右眼
drawArc(150, 180, 20, 0, 2,