Page 1 of 1

Color Fire!

Posted: Sat Nov 16, 2019 12:31 am
by Dr. Madskull
Taking the old fire screen saver and adding colors. Simple and beatiful!

The default is a blue spooky tint, but you can easily change it by enabling the code block you desire:

Code: Select all

// Orange is the new red.
{
  fireArray[i][0].r=Math.floor(Math.random()*256); // Using floor means it never reach 256. 

  // To get pitch dark areas. 
  if(fireArray[i][0].r < 150)
    fireArray[i][0].r = 0;
  
  fireArray[i][0].g=Math.floor(Math.random()*fireArray[i][0].r);
  fireArray[i][0].b=0;
}
Try fiddling with the r g b values, it get pretty pretty easy. :mrgreen: