From 2127c61eeeea920ba79923bc6f29a1e2de80d61d Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 30 May 2014 12:46:40 +1000 Subject: [PATCH] frame demo: Fix bug for displays with < 32 bit color --- demos/modules/gwin/frame/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/demos/modules/gwin/frame/main.c b/demos/modules/gwin/frame/main.c index 0ba0595d..2acf901c 100644 --- a/demos/modules/gwin/frame/main.c +++ b/demos/modules/gwin/frame/main.c @@ -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);