Random Canvase Colors

Get help using Construct 2

Post » Fri Apr 26, 2013 3:56 pm

I know this may be a re-cap for some, but I have searched the forums and tried everything... (Been away a while, so I am rusty...)

How do you select a random color using canvase?

It wants a string, but "rgba("&random(255)&","&random(255)&","&random(255)&",1)" does not work... (I think because it wants that whole string in quotes, and i dont know how to do that.)

Thanks in advance!
B
192
S
6
G
7
Posts: 213
Reputation: 10,178

Post » Fri Apr 26, 2013 4:15 pm

I hate it when I post then find the answer a couple minutes later...   Well, if anyone else need to know, here is a way to do it:

canvas -> Fill canvas with color -> str("rgb("&INT(random(255))&","&INT(random(255))&","&INT(random(255)))

str() will make everything in the () into a string. :) Yea, it is coming back to me now... (you can change INT(random(255) to a variable of any kind with an INT value between 0 and 255.)
B
192
S
6
G
7
Posts: 213
Reputation: 10,178


Return to How do I....?

Who is online

Users browsing this forum: h1k3, Unconnected and 0 guests