b. Setting Screen Background Color

<< Click to Display Table of Contents >>

Navigation:  Tutorials > Tutorial 09 - Setting Graphics Context >

b. Setting Screen Background Color

This section shows how to change the screen background color using the SetBackgroundcolor() command.



Command Prototype


uint16_t SetBackgroundcolor(uint32_t argb)





Color values (for example - red, yellow, green etc.)






void setup()


/* Initialize CleO - needs to be done only once */



/* Set background color */



/* Start building a screen frame */



 /* Draw string */

 CleO.StringExt(FONT_MEDIUM, 400, 240, YELLOW, MM, 0, 0, "Hello world");


 /* Display completed screen frame */




void loop() {}





The above code snippet uses the SetBackgroundcolor() command to set the screen background color.

You may select a different color by changing the color value in the parameter.

Pre-defined color can be found in the "colornames.h." Alternately, users can also define their ARGB format (for ex:0x00FF00).





Here is the output displayed upon executing the above code snippet -