frame demo: Fix bug for displays with < 32 bit color

ugfx_release_2.6
inmarket 2014-05-30 12:46:40 +10:00
parent 25ce0ed7d6
commit 2127c61eee
1 changed files with 4 additions and 5 deletions

View File

@ -8,12 +8,11 @@ static GHandle ghButton1, ghButton2, ghButton3;
static GHandle ghWindow1;
static void _updateColor(void) {
color_t color;
uint32_t color;
color = 0;
color |= (0xFF0000 & (gwinSliderGetPosition(ghSliderR)) << 16);
color |= (0x00FF00 & (gwinSliderGetPosition(ghSliderG)) << 8);
color |= (0x0000FF & (gwinSliderGetPosition(ghSliderB)) << 0);
color = (unsigned)gwinSliderGetPosition(ghSliderR) << 16;
color |= (unsigned)gwinSliderGetPosition(ghSliderG) << 8;
color |= (unsigned)gwinSliderGetPosition(ghSliderB) << 0;
gwinSetBgColor(ghWindow1, HTML2COLOR(color));
gwinClear(ghWindow1);