aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-05-30 12:46:40 +1000
committerinmarket <andrewh@inmarket.com.au>2014-05-30 12:46:40 +1000
commit2127c61eeeea920ba79923bc6f29a1e2de80d61d (patch)
tree770e0f4c6b6b65b264d8007cc63abdbad79e9e37 /demos
parent25ce0ed7d6217e6f355dd069bba2b3ca1b63b5e3 (diff)
downloaduGFX-2127c61eeeea920ba79923bc6f29a1e2de80d61d.tar.gz
uGFX-2127c61eeeea920ba79923bc6f29a1e2de80d61d.tar.bz2
uGFX-2127c61eeeea920ba79923bc6f29a1e2de80d61d.zip
frame demo: Fix bug for displays with < 32 bit color
Diffstat (limited to 'demos')
-rw-r--r--demos/modules/gwin/frame/main.c9
1 files 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);