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.

Not sending 6byte RGBW value !
#1
Hi everyone! 
I am having trouble with sending 6byte RGBW value. I can't send value to it, for example I want to send value #EB00EB to address 1/7/0 , but it gives error.
------------
grp.write('1/7/0', #EB00EB)
------------
Reply
#2
You must pass a table as the value for 6-byte RGBW. Each color is in 0..255 range.
Code:
grp.write('1/7/0', {
  red = 255,
  blue = 0,
  green = 127,
  white = 127
})

Standard RGB/RGBW types use numeric values which can be specified in hexadecimal form as 0xRRGGBB or 0xRRGGBBWW respectively.
Reply
#3
Thanks Admin. so much !
Reply
#4
Hi everyone!
Today I tried the value is 3byte color (3byte format is: 232,600 RGB color). I want to write this value but it does not do #FFA33A to the value 2/7/42
grp.write('2/7/42', { red = 255, green = 163, blue = 58})
Does anyone know why?
Thank you very much everyone!

Attached Files Thumbnail(s)
   
Reply
#5
Unlike the 6 byte that requires a table to be passed is the 3 byte an integer (you can check this by logging the value it reports)

Just use:
Code:
grp.write('2/7/42', 0xFFA33A)
 or
Code:
r = 255
g = 163
b = 58
rgb = lmcore.hextoint(lmcore.inttohex(r,1) .. lmcore.inttohex(g,1) .. lmcore.inttohex(b,1))
grp.write('2/7/42', rgb)
Reply
#6
This should be helpful too: https://kb.logicmachine.net/scripting/rg...gb-3-bytes
Reply


Forum Jump: