Hi, I'm trying to use predefined colours with "setColor".
setColor(0,255,255,255);
would set the colour to white.
Now I've tried to use strutcs to define colours, but without success.
Here's an example of what I'm trying:
`// define a struct for RGB colours
struct RGB
{
byte red;
byte green;
byte blue;
};
// predefine colours, assign R, G and B
const RGB purple = {255, 65, 12}; // r, g, b
const RGB white = {255, 255, 255}; // r, g, b So far, so good. But using ucg.setColor(0, white); // use white as main color for the font`
produces the error
no matching function for call to 'Ucglib_ILI9341_18x240x320_HWSPI::setColor(int, const RGB&)'
Guess I'm making a stupid mistake here ?
Any ideas how to solve this ?
Best regards, stay safe !
Stupid me,
of course I have to "unpack" the struct in this case ...
ucg.setColor(0, cyan.red, cyan.green, cyan.blue);
Sorry for the question, guess I looked at it too often ;-)
Hi, I'm trying to use predefined colours with "setColor".
setColor(0,255,255,255);
would set the colour to white. Now I've tried to use strutcs to define colours, but without success. Here's an example of what I'm trying:`// define a struct for RGB colours struct RGB { byte red; byte green; byte blue; };
// predefine colours, assign R, G and B const RGB purple = {255, 65, 12}; // r, g, b const RGB white = {255, 255, 255}; // r, g, b
So far, so good. But using
ucg.setColor(0, white); // use white as main color for the font` produces the errorGuess I'm making a stupid mistake here ?
Any ideas how to solve this ?
Best regards, stay safe !