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 write 3 byte RGB value
#1
Hi,

I want to set the color of RGB Led by HL, how can I write, for example, the blue color?
In ETS I write this way: 0 0 255  (the datatype is 232.600 - RGB value 3x(0..255))

Thanks!
Reply
#2
You can use hex value, like 0x0000FF for blue only.

Or specify color in 0..255 range like this:
Code:
r = 0
g = 0
b = 255

rgb = bit.bor(bit.lshift(r, 16), bit.lshift(g, 8), b)
Reply
#3
Thank you! Smile
Reply


Forum Jump: