php画奥运五环颜色,canvas绘制奥运五环代码分享

运行效果:

f654233e706fca89194eb4864dc629f2.png

A drawing of someing!

context.lineWidth = 7;

context.strokeStyle = '#0180C3';

context.beginPath();

context.arc(70, 70, 40, 0, 2*Math.PI, false);

context.stroke();

context.strokeStyle = '#000';

context.beginPath();

context.arc(160, 70, 40, 0, 2*Math.PI, false);

context.stroke();

context.strokeStyle = '#BF0628';

context.beginPath();

context.arc(250, 70, 40, 0, 2*Math.PI, false);

context.stroke();

context.strokeStyle = '#EBC41F';

context.beginPath();

context.arc(115, 110, 40, 0, 2*Math.PI, false);

context.stroke();

context.strokeStyle = '#198E4A';

context.beginPath();

context.arc(205, 110, 40, 0, 2*Math.PI, false);

context.stroke();//环环相扣,画弧(实现相关圆弧的覆盖)context.strokeStyle = '#0180C3';

context.beginPath();

context.arc(70, 70, 40, 1.9*Math.PI, 2.1*Math.PI, false);

context.stroke();

context.strokeStyle = '#000';

context.beginPath();

context.arc(160, 70, 40, 1.9*Math.PI, 2.1*Math.PI, false);

context.stroke();

context.beginPath();

context.arc(160, 70, 40, 0.5*Math.PI, 0.7*Math.PI, false);

context.stroke();

context.strokeStyle = '#BF0628';

context.beginPath();

context.arc(250, 70, 40, 0.5*Math.PI, 0.7*Math.PI, false);

context.stroke();

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值