aboutsummaryrefslogtreecommitdiffstats
path: root/demos/applications
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-03-10 20:36:12 +1000
committerinmarket <andrewh@inmarket.com.au>2018-03-10 20:36:12 +1000
commit94f1cc2f0a4db0c6f1483e6d648068e031bcc094 (patch)
tree97f50372239108ec9e6e75a3d56e808e479cb7be /demos/applications
parentf265924396167729e8d9fb36a0383263f36c1270 (diff)
downloaduGFX-94f1cc2f0a4db0c6f1483e6d648068e031bcc094.tar.gz
uGFX-94f1cc2f0a4db0c6f1483e6d648068e031bcc094.tar.bz2
uGFX-94f1cc2f0a4db0c6f1483e6d648068e031bcc094.zip
Change new colors to GFX_RED instead of GFXRED. Use the new color defs
Diffstat (limited to 'demos/applications')
-rw-r--r--demos/applications/combo/bounce.c6
-rw-r--r--demos/applications/combo/main.c6
-rw-r--r--demos/applications/notepad/main.c40
3 files changed, 26 insertions, 26 deletions
diff --git a/demos/applications/combo/bounce.c b/demos/applications/combo/bounce.c
index 54938414..c669eff2 100644
--- a/demos/applications/combo/bounce.c
+++ b/demos/applications/combo/bounce.c
@@ -55,8 +55,8 @@ static gfxThreadHandle thread;
* #define GMISC_INVSQRT_REAL_SLOW GFXON
* in your gfxconf.h file. This should always work although it will probably be slow.
*/
-#define BALLCOLOR1 Red
-#define BALLCOLOR2 Yellow
+#define BALLCOLOR1 GFX_RED
+#define BALLCOLOR2 GFX_YELLOW
#define WALLCOLOR HTML2COLOR(0x303030)
#define BACKCOLOR HTML2COLOR(0xC0C0C0)
#define FLOORCOLOR HTML2COLOR(0x606060)
@@ -117,7 +117,7 @@ static DECLARE_THREAD_FUNCTION(task, param) {
// The ball shadow is darker
if (g*(g+.4)+h*(h+.1) < 1)
- colour = gdispBlendColor(colour, Black, SHADOWALPHA);
+ colour = gdispBlendColor(colour, GFX_BLACK, SHADOWALPHA);
}
gdispStreamColor(colour); /* pixel to the LCD */
}
diff --git a/demos/applications/combo/main.c b/demos/applications/combo/main.c
index 449572d9..4585a74e 100644
--- a/demos/applications/combo/main.c
+++ b/demos/applications/combo/main.c
@@ -41,7 +41,7 @@
/* Our custom yellow style */
static const GWidgetStyle YellowWidgetStyle = {
- Yellow, // window background
+ GFX_YELLOW, // window background
HTML2COLOR(0x800000), // focus - for text edit.
// enabled color set
@@ -168,7 +168,7 @@ static void createWidgets(void) {
wi.g.x = pagewidth;
wi.g.width = pagewidth;
ghConsole = gwinConsoleCreate(0, &wi.g);
- gwinSetColor(ghConsole, Black);
+ gwinSetColor(ghConsole, GFX_BLACK);
gwinSetBgColor(ghConsole, HTML2COLOR(0xF0F0F0));
// Buttons
@@ -405,7 +405,7 @@ int main(void) {
font = gdispOpenFont("*"); // Get the first defined font.
gwinSetDefaultFont(font);
gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
- gdispClear(White);
+ gdispClear(GFX_WHITE);
// Create the gwin windows/widgets
createWidgets();
diff --git a/demos/applications/notepad/main.c b/demos/applications/notepad/main.c
index 16120edd..de24f227 100644
--- a/demos/applications/notepad/main.c
+++ b/demos/applications/notepad/main.c
@@ -49,23 +49,23 @@ void drawScreen(void) {
font1 = gdispOpenFont("DejaVuSans24*");
font2 = gdispOpenFont("DejaVuSans12*");
- gdispClear(White);
- gdispDrawString(gdispGetWidth()-gdispGetStringWidth(msg, font1)-3, 3, msg, font1, Black);
+ gdispClear(GFX_WHITE);
+ gdispDrawString(gdispGetWidth()-gdispGetStringWidth(msg, font1)-3, 3, msg, font1, GFX_BLACK);
/* colors */
- gdispFillArea(0 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Black); /* Black */
- gdispFillArea(1 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Red); /* Red */
- gdispFillArea(2 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Yellow); /* Yellow */
- gdispFillArea(3 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Green); /* Green */
- gdispFillArea(4 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Blue); /* Blue */
- gdispDrawBox (5 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, Black); /* White */
+ gdispFillArea(0 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_BLACK); /* Black */
+ gdispFillArea(1 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_RED); /* Red */
+ gdispFillArea(2 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_YELLOW); /* Yellow */
+ gdispFillArea(3 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_GREEN); /* Green */
+ gdispFillArea(4 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_BLUE); /* Blue */
+ gdispDrawBox (5 * COLOR_SIZE + 3, 3, COLOR_SIZE, COLOR_SIZE, GFX_WHITE); /* White */
/* pens */
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(1), PEN_SIZE, PEN_SIZE, "1", font2, White, Black, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(2), PEN_SIZE, PEN_SIZE, "2", font2, White, Black, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(3), PEN_SIZE, PEN_SIZE, "3", font2, White, Black, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(4), PEN_SIZE, PEN_SIZE, "4", font2, White, Black, justifyCenter);
- gdispFillStringBox(OFFSET * 2, DRAW_PEN(5), PEN_SIZE, PEN_SIZE, "5", font2, White, Black, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(1), PEN_SIZE, PEN_SIZE, "1", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(2), PEN_SIZE, PEN_SIZE, "2", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(3), PEN_SIZE, PEN_SIZE, "3", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(4), PEN_SIZE, PEN_SIZE, "4", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
+ gdispFillStringBox(OFFSET * 2, DRAW_PEN(5), PEN_SIZE, PEN_SIZE, "5", font2, GFX_WHITE, GFX_BLACK, justifyCenter);
gdispCloseFont(font1);
gdispCloseFont(font2);
@@ -74,7 +74,7 @@ void drawScreen(void) {
GEventMouse ev;
int main(void) {
- color_t color = Black;
+ color_t color = GFX_BLACK;
uint16_t pen = 0;
gfxInit();
@@ -89,12 +89,12 @@ int main(void) {
/* inside color box ? */
if(ev.y >= OFFSET && ev.y <= COLOR_SIZE) {
- if(GET_COLOR(0)) color = Black;
- else if(GET_COLOR(1)) color = Red;
- else if(GET_COLOR(2)) color = Yellow;
- else if(GET_COLOR(3)) color = Green;
- else if(GET_COLOR(4)) color = Blue;
- else if(GET_COLOR(5)) color = White;
+ if(GET_COLOR(0)) color = GFX_BLACK;
+ else if(GET_COLOR(1)) color = GFX_RED;
+ else if(GET_COLOR(2)) color = GFX_YELLOW;
+ else if(GET_COLOR(3)) color = GFX_GREEN;
+ else if(GET_COLOR(4)) color = GFX_BLUE;
+ else if(GET_COLOR(5)) color = GFX_WHITE;
/* inside pen box ? */
} else if(ev.x >= OFFSET && ev.x <= PEN_SIZE) {