This repository has been archived by the owner on Dec 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
changeLabelTextColor()
Mammad900 edited this page Sep 2, 2020
·
1 revision
Changes the color of a label (e.g. a green label becomes red)
- Page (
int
) : The number of the page which contains the label - Index (
int
) : The index of the label relative to it's containing page. - Value (
uint16_t
) : The new color for the label (a 16-bit RGB565 color value)
Nothing
void displayError(String message){
changeLabelText(PAGE_CONNECT, STATUS_LABEL, message);
changeLabelTextColor(PAGE_CONNECT, STATUS_LABEL, TFT_RED); // TFT_RED is defined in MCUFRIEND_kbv library, but you should define PAGE_CONNECT and STATUS_LABEL yourself
}
void changeLabelTextColor(int page, int i, uint16_t val) {
if (label_textColor[page][i] != val) {
HCT
label_textColor[page][i] = val;
if (CurrentPage == page)
drawlabel(page, i);
}
}
Note: HCT
is a macro for making the rest of the library aware that something has changed.