js在html画布中设置笔触不透明度(相同的rgb,但不同的alpha)

时间:2015-08-04 22:36:06

标签: javascript canvas

我的代码(o先前已定义):

colors = document.getElementsByClassName('active')[0].style.backgroundColor.substring(colorString.indexOf('(') + 1, colorString.lastIndexOf(')')).split(/,\s*/);
red = colors[0];
green = colors[1];
blue = colors[2];

canvas.strokeStyle = "rgba("+red+","+green+","+blue+","+o+")";

0 个答案:

没有答案