Using color as rgb on HUB75

hi, i am trying the SmartMatrix for a GPS-clock. It work great! Thanks therefor. But i have a question to the HexColors: I will show the Outdoor-Temperture on the HUB75 in Colors similar to the Temp. What can i do to switch the colors from Hex to RGB in the Sketch like “setColor(25,155,255);” as it works in PxMatrix? Thanks a lot for your Help!

Please clarify, what the color values you have and what you need

the ColorValue is between 0-100% (0 red, 0 green, 100 blue) at -20 degree and (100 red, 0 green, 0 blue) at + 30 degree °C. Thank you to help a newbie

This doesn’t explain what the HEX colors has to do with it.

Please show your code - how did you try to solve the problem.

please, don’t laugh, this is that what i have tried, I’m searching for the “rgb16” position…
int redValue = map((temp), -20, 30, 0, 255);
int blueValue = map(temp, -20, 30, 255, 0);
int greenValue = map((temp), -20, 30, 0, 0);
indexedLayer.setColor,( rgb16(redValue, greenValue, blueValue));
i see that in this combination the temp value leads to changing colors, but the value works with the HEX-definitions.
In a PxMatrix-Sketch this works with “display.setTextColor(display.color565(redValue, greenValue, blueValue));”
thanks a lot

SmartMatrix Library uses rgb24 (8 bits per color) not rgb565 natively. Try something like this:

rgb24 myColor;
myColor.red = redValue;
myColor.green = greenValue;
myColor.blue = blueValue;
indexedLayer.setColor(myColor);
1 Like

Hi Lois,
it seems to work as expected.
Thanks a lot!!!
greetings