Gradient Progress Bar

dezso
I'm trying to modify the main.c  for mini6410 bootloader.
The listed code spouse create a nice blue gradient but the colors does not
work as I expected.
This line convert the 3 hex color in option.h 
#define PROGRESS_BAR_COLOR  ( ( (PROGRESS_BAR_R >> 3) << 11) |
((PROGRESS_BAR_G >> 2) << 5) | (PROGRESS_BAR_B >> 3) )

My hex values is from adobe, might be inverted on the whole approach is
wrong ?

static void ProgressBarStep(void)
{
  Retail += PROGRESS_BAR_WIDTH;
  while (Retail > Total) {
    int y;
    unsigned short *p = (unsigned short *)CurrAddrInLCD;
    // draw a vertial line, with 1 width
    Retail -= Total;
      *p = 0x4961a9;
      p += LCD_WIDTH;
      *p = 0x1f3e96;
      p += LCD_WIDTH;
      *p = 0x29479e;
      p += LCD_WIDTH;
      *p = 0x3553a9;
      p += LCD_WIDTH;
      *p = 0x4361b5;
      p += LCD_WIDTH;
      *p = 0x5572c3;
      p += LCD_WIDTH;
      *p = 0x6683d1;
      p += LCD_WIDTH;
      *p = 0x708dd8;
      p += LCD_WIDTH;
      *p = 0x4a6cab;
      p += LCD_WIDTH;
      *p = 0x4064a0;
      p += LCD_WIDTH;
      *p = 0x375b96;
      p += LCD_WIDTH;
      *p = 0x2d538c;
      p += LCD_WIDTH;
      *p = 0x254b83;
      p += LCD_WIDTH;
      *p = 0x1f467c;
      p += LCD_WIDTH;

    //for (y = 0; y < PROGRESS_BAR_HEIGHT; y++) {
    //  *p = PROGRESS_BAR_COLOR;
    //  p += LCD_WIDTH;
    //}
    CurrAddrInLCD += 2;
  }
}

Dezso
Got it working by making 14 #define statement in option.h for each collor. 
Code available if anyone interested. 

Check out the result. 
http://youtu.be/nHH0RqdKry0

dezso
Windows file
http://www.filedropper.com/gradien2pixelcolor
Instruction
http://youtu.be/MciPR5RsDD4

brox
Just wonder, what would you do if you need to draw vertical gradient of
height 1000? Go ahead, write 2000 lines of code)

dezso
No, I would go with your "non existing"  solution !
I don't thing anyone would want to 100 pixel high progress bar at boot, but
if you want to use my IDEA than you are welcome.