   sunnrise in 2d game
  Could anyone explain the theory behind simulating a sunrise effect in a 2d game? Basically the world slowly gets lighter and lighter. I am not using pallettes but instead using the pixel buffer. So what would I have to theoretically do to the pixel of my final image to make it look like the light source is getting brighter? This is all 2d.    
  i would guess that you could scale each color componet by the same amount until you get the desired brightnessexample float scale_rate = 1.05;   //5% increase in brightnessfor (int i = 0; i < number_of_times_to_increase; i++){   pixel.r = pixel.r * scale_rate;   pixel.g = pixel.g * scale_rate;   pixel.b = pixel.b * scale_rate;   if (pixel.r > 255)   {// cap the value to the maximum amountpixel.r = 255;   }   // repeat cap for g and b}something like that might workto simulate nightfall you could replace the scale_rate with something like 0.95 to get a 5% decrease per time through the loop   "A soldier is a part of the 1% of the population that keeps the other 99% free"  - Lt. Colonel Todd, 1/38th Infantry, Ft. Benning, GA 