[Javascript] Gradually change hex color

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,288
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.
Back
Top