Random Canvase Colors

0 favourites
  • 2 posts
From the Asset Store
Full game Construct 2 capx code source to post on Google Play
  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)