frame demo: Fix bug for displays with < 32 bit color
This commit is contained in:
parent
25ce0ed7d6
commit
2127c61eee
1 changed files with 4 additions and 5 deletions
|
@ -8,12 +8,11 @@ static GHandle ghButton1, ghButton2, ghButton3;
|
||||||
static GHandle ghWindow1;
|
static GHandle ghWindow1;
|
||||||
|
|
||||||
static void _updateColor(void) {
|
static void _updateColor(void) {
|
||||||
color_t color;
|
uint32_t color;
|
||||||
|
|
||||||
color = 0;
|
color = (unsigned)gwinSliderGetPosition(ghSliderR) << 16;
|
||||||
color |= (0xFF0000 & (gwinSliderGetPosition(ghSliderR)) << 16);
|
color |= (unsigned)gwinSliderGetPosition(ghSliderG) << 8;
|
||||||
color |= (0x00FF00 & (gwinSliderGetPosition(ghSliderG)) << 8);
|
color |= (unsigned)gwinSliderGetPosition(ghSliderB) << 0;
|
||||||
color |= (0x0000FF & (gwinSliderGetPosition(ghSliderB)) << 0);
|
|
||||||
|
|
||||||
gwinSetBgColor(ghWindow1, HTML2COLOR(color));
|
gwinSetBgColor(ghWindow1, HTML2COLOR(color));
|
||||||
gwinClear(ghWindow1);
|
gwinClear(ghWindow1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue