This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

How to use new datatype RGB-W
#23
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
Reply


Messages In This Thread
How to use new datatype RGB-W - by gdimaria - 14.08.2020, 12:30
RE: How to use new datatype RGB-W - by Daniel - 14.08.2020, 12:57
RE: How to use new datatype RGB-W - by admin - 14.08.2020, 12:59
RE: How to use new datatype RGB-W - by admin - 25.08.2020, 11:38
RE: How to use new datatype RGB-W - by admin - 25.08.2020, 13:00
RE: How to use new datatype RGB-W - by Daniel - 25.08.2020, 15:57
RE: How to use new datatype RGB-W - by admin - 26.08.2020, 08:12
RE: How to use new datatype RGB-W - by Daniel - 26.08.2020, 08:12
RE: Urgent! - by gdimaria - 18.09.2020, 08:07
RE: How to use new datatype RGB-W - by Daniel - 18.09.2020, 08:09
RE: How to use new datatype RGB-W - by admin - 18.09.2020, 08:12
RE: How to use new datatype RGB-W - by gdimaria - 22.09.2020, 13:20
RE: How to use new datatype RGB-W - by Daniel - 22.09.2020, 13:52
RE: How to use new datatype RGB-W - by Daniel - 22.09.2020, 15:20
RE: How to use new datatype RGB-W - by Daniel - 23.09.2020, 07:55
RE: How to use new datatype RGB-W - by Daniel - 23.09.2020, 08:18
RE: How to use new datatype RGB-W - by Daniel - 24.09.2020, 08:44

Forum Jump: