--- starfield.c	2006-03-03 13:24:38.000000000 +0100
+++ color-starfield.c	2006-03-16 23:46:22.000000000 +0100
@@ -92,7 +85,10 @@ struct star
 {
     int x,y,z;
     int velocity;
+#if LCD_DEPTH > 1
+    int color;
+#endif
 };
 
 static inline void star_init(struct star * star, int z_move)
 {
@@ -100,6 +108,9 @@ static inline void star_init(struct star
     /* choose x between -MAX_INIT_STAR_X and MAX_INIT_STAR_X */
     star->x=rb->rand() % (2*MAX_INIT_STAR_X)-MAX_INIT_STAR_X;
     star->y=rb->rand() % (2*MAX_INIT_STAR_Y)-MAX_INIT_STAR_Y;
+#if LCD_DEPTH > 1
+    star->color=LCD_RGBPACK(rb->rand()%128+128,rb->rand()%128+128,rb->rand()%128+128);//rb->rand() % (sizeof(colors) / sizeof(unsigned));
+#endif
     if(z_move>=0)
         star->z=Z_MAX_DIST;
     else
@@ -132,6 +143,10 @@ static inline void star_draw(struct star
         star_init(star, z_move);
         return;
     }
+#if LCD_DEPTH > 1
+    rb->lcd_set_foreground(star->color);
+#endif
+
     rb->lcd_drawpixel(x_draw, y_draw);
     if(star->z<5*Z_MAX_DIST/6)
     {
@@ -225,6 +240,9 @@ int plugin_main(void)
                          "star:%d speed:%d",
                          starfield.nb_stars,
                          starfield.z_move);
+#if LCD_DEPTH > 1
+            rb->lcd_set_foreground(LCD_WHITE);
+#endif
             rb->lcd_putsxy(0, LCD_HEIGHT-font_h, str_buffer);
         }
         rb->lcd_update();

