• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Javascript] Gradually change hex color

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,239
I was wondering if there's an relatively simple way to increase hex color.

Currently I am using the following
JavaScript:
particles[i].material.color.setHex(Math.random() * 0x808008 + 0x808080);

Which gives each particle a new random color. So I was thinking that it would be better to just increase it gradually so currentHexColor += 1;
Which would probably work for a while until it reaches the cap and goes completely white and is still there?
 
Status
Not open for further replies.
Top