I'm making a part of my game which draws a gradient of pretty colors to the screen using allegro (eventually I will animate it by changing the palette, but for now I will keep it still) Well, anyway, the program compiles fine, but when the program runs, instead of filling the screen with pretty colors, allegro fills the top row of pixels with pretty colors.

arg.

here's my code if anyone can help:
Code:
#include <allegro.h>
#define SW 640
#define SH 480

int do_pretty_colors(void)
{
 int x = 0;
 int y = 0;
 BITMAP *bmp = create_bitmap(SW, SH);
 long color = 0;
 int z = 0;
 clear_bitmap(bmp);
 while(z == 0)
 {
  while(x < SW)
  {
   if(color - y <= 0)
   {
    putpixel(bmp,x,y, 0);
   }
   else
   {
    putpixel(bmp,x,y, color-y);
   }
   x++;
   color++;
  }
  if(y = SH)
  {
   blit(bmp, screen, 0, 0, 0, 0, SW, SH);
   return 0;
  }
  else
  {
   y++;
   x=0;
   color=0;
  }
 }
 return 0;
}



int main() 
{ 
 // Initialize Allegro.        
 allegro_init();      
 set_color_depth(32);
 set_gfx_mode(GFX_AUTODETECT, SW, SH, 0, 0);


 install_keyboard();

 do_pretty_colors();


 while(! key[KEY_ESC])
   poll_keyboard(); .


 allegro_exit();
 return 0;     
}     

END_OF_MAIN();