How do I calculate bright colors?

0 favourites
• 5 posts
From the Asset Store
Full game Construct 2 capx code source to post on Google Play
• I want to generate random bright colors. Currently I use rgbEx(random(75,100),random(75,100),random(75,100)). But the issue with it is that colors of "white section" are generated

Any idea how to do this? Thanks

• Whites happens when all three values are high and similar to each other. To avoid this, you'll want at least one of the values to be low.

• Whites happens when all three values are high and similar to each other. To avoid this, you'll want at least one of the values to be low.

Any cheaper way to do this? Otherwise I can do it but it will be a very long process (lots of condition etc)

• It doesn't have to be that complicated. All you need to do is randomly pick one of the 3 values to be a low range. You can do it with one event :)

Why not set color to:

`choose(rgbEx(random(0,25),random(75,100),random(75,100)),rgbEx(random(75,100),random(0,25),random(75,100)),rgbEx(random(75,100),random(75,100),random(0,25)))`

I've tested this and I think it works pretty well :)

• Try Construct 3

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

Construct 3 users don't see these ads
• Why not just do a pallet?

You can save the color as a number value using the formula: R+(G*256)+(B*65536)

It can go into a variable using int(tokenat()), or into an array as a stack.