Quantcast
Channel: Specifically change stroke opacity but not color on canvas - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Specifically change stroke opacity but not color on canvas

$
0
0

I have a nice tidy script that cycles through colors and it works nicely with the #xxxxxx format, but I want to change the transparency. Is there a way to do that?

I'm referring to ctx.strokeStyle()

Here's the current code:

canvas.strokeStyle = '#'+ (((16777215 / s.length) * i).toString(16));

It cycles through a for loop with i incremented by 1 each cycle and it's a part of a switch. The for loop looks like this: for(var i = 0; i < s.length; i++){}


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images