22.09.2020, 13:20
It's very strange: when I pickup a preseted colour (I preseted 6) everything is working fine. If I choose a color from RGB Palette, it returns a wrong color.
Can you help me?
Here are my RGB Scripts:
--- mergeRGBW ----
if event.sender == 'se' then
return
end
IndRichiesta = event.dst
len = string.len(IndRichiesta)
suffisso = string.sub(IndRichiesta, -(len-5))
--log(IndRichiesta)
R = grp.getvalue('11/4/'..suffisso)
G = grp.getvalue('12/4/'..suffisso)
B = grp.getvalue('13/4/'..suffisso)
W = grp.getvalue('10/4/'..suffisso)
RGBW = R * 0x1000000 + G * 0x10000 + B * 0x100 + W
grp.checkupdate('40/4/'..suffisso, RGBW) --- icon address
------- splitRGBW -----
if event.sender == 'se' then
return
end
value = event.getvalue() ---- from 32/1/20 icon address
-- 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)
IndRichiesta = event.dst
len = string.len(IndRichiesta)
suffisso = string.sub(IndRichiesta, -(len-5))
grp.checkwrite('11/3/'..suffisso, R)
grp.checkwrite('12/3/'..suffisso, G)
grp.checkwrite('13/3/'..suffisso, B)
grp.checkwrite('10/3/'..suffisso, W)
-------------------------------
Thanks, Peppe
Can you help me?
Here are my RGB Scripts:
--- mergeRGBW ----
if event.sender == 'se' then
return
end
IndRichiesta = event.dst
len = string.len(IndRichiesta)
suffisso = string.sub(IndRichiesta, -(len-5))
--log(IndRichiesta)
R = grp.getvalue('11/4/'..suffisso)
G = grp.getvalue('12/4/'..suffisso)
B = grp.getvalue('13/4/'..suffisso)
W = grp.getvalue('10/4/'..suffisso)
RGBW = R * 0x1000000 + G * 0x10000 + B * 0x100 + W
grp.checkupdate('40/4/'..suffisso, RGBW) --- icon address
------- splitRGBW -----
if event.sender == 'se' then
return
end
value = event.getvalue() ---- from 32/1/20 icon address
-- 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)
IndRichiesta = event.dst
len = string.len(IndRichiesta)
suffisso = string.sub(IndRichiesta, -(len-5))
grp.checkwrite('11/3/'..suffisso, R)
grp.checkwrite('12/3/'..suffisso, G)
grp.checkwrite('13/3/'..suffisso, B)
grp.checkwrite('10/3/'..suffisso, W)
-------------------------------
Thanks, Peppe