How do I calculate bright colors?

0 favourites
  • 5 posts
From the Asset Store
Creepy Sprite Font suitable font for your Dark/Horror/Halloween games.
  • 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.

  • Try Construct 3

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

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

    BTW thanks for the reply

  • 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 :)

  • 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.

    Also:https://www.construct.net/en/make-games/addons/577/color-variable

    I have not messed with it yet though.

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