• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Javascript] Gradually change hex color

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
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