Greetings,
I'm missing something about changing the colors in a color palette using graphx.h. So I would really appreciate it if someone would be willing to explain it to me.
From the website:
https://ce-programming.github.io/toolchain/libraries/graphx.html
"Overview" I understand that RGB colors are converted into RGB1555 colors using gfx_RGBTo1555(r,g,b); where r,g,b are the red, green, blue intensity values between 0 and 255. I want to change a color in the default color palette. As outline in the website, I would use the following code:
Code:
From the Toolchain examples folder /library_examples/keypadc/single keys I modified the function given in that example as follows:
Code:
As a test, I replaced the variables r,g,b with the values 0.,255,0 (green).
As I understand it, according to the website,index 0, which was black should now be set to green. But, when I test it, index 0 is still black. Choosing a different index, say 224(red) will display red, not green.
I also included gfx_Begin & gfx_End inside this function which also didn't work.
Anyway, I'm sure it's something simple, but I'm just missing it.
I'm missing something about changing the colors in a color palette using graphx.h. So I would really appreciate it if someone would be willing to explain it to me.
From the website:
https://ce-programming.github.io/toolchain/libraries/graphx.html
"Overview" I understand that RGB colors are converted into RGB1555 colors using gfx_RGBTo1555(r,g,b); where r,g,b are the red, green, blue intensity values between 0 and 255. I want to change a color in the default color palette. As outline in the website, I would use the following code:
Code:
gfx_palette[index] = gfx_RGBTo1555(r,g,b);
From the Toolchain examples folder /library_examples/keypadc/single keys I modified the function given in that example as follows:
Code:
void FillScreen(uint16_t r,uint16_t g,uint16_t b)
{
gfx_palette[0] = gfx_RGBTo1555(0, 255, 0);
memset((void*)lcd_Ram,0, LCD_SIZE);
}
As a test, I replaced the variables r,g,b with the values 0.,255,0 (green).
As I understand it, according to the website,index 0, which was black should now be set to green. But, when I test it, index 0 is still black. Choosing a different index, say 224(red) will display red, not green.
I also included gfx_Begin & gfx_End inside this function which also didn't work.
Anyway, I'm sure it's something simple, but I'm just missing it.