25.08.2020, 09:49
(23.08.2020, 10:02)Erwin van der Zwart Wrote: Hi,
Use this for 4 byte RGBW:
BR,Code:value = event.getvalue() -- Split R = bit.rshift(bit.band(value,0xff000000),24) G = bit.rshift(bit.band(value,0x00ff0000),16) B = bit.rshift(bit.band(value,0x0000ff00),8) W = bit.band(value,0x000000ff) -- Merge RGBW = R * 0x1000000 + G * 0x10000 + B * 0x100 + W
Erwin
I think there is a little mistake in that code because the colors shown by the icon don't match both ways: splitting and merging.