Home  >  Article  >  Web Front-end  >  HTML5如何为形状图上颜色怎么绘制具有颜色和透明度的矩形_html5教程技巧

HTML5如何为形状图上颜色怎么绘制具有颜色和透明度的矩形_html5教程技巧

WBOY
WBOYOriginal
2016-05-16 15:47:311958browse
一、自定义画笔样式

如果想为形状图上颜色,需要使用以下两个重要的属性。

fillStyle : 设置下来所有fill操作的默认颜色。
strokeStyle : 设置下来所有stroke操作的默认颜色。

二、绘制具有颜色和透明度的矩形

复制代码
代码如下:





HTML5





提示:你的浏览器不支持标签




三、绘制效果
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn