updated example

This commit is contained in:
2021-06-23 14:15:51 -05:00
parent 13705aa0bd
commit 3b0ee59f47

View File

@@ -1,6 +1,6 @@
-- 0-255, 0-255, 0-255, 0-100
function rgba(R, G, B, A)
A = A or 100
A = A + 0.5 - (A + 0.5) % 1
return ((R&0x0ff)<<0x00)|((G&0x0ff)<<0x08)|((B&0x0ff)<<0x10)|((A&0x0ff)<<0x18)
-- 0-255, 0-255, 0-255, [0-1]
function rgb(r,g,b,a)
a = (a or 1) * 255
a = a + 0.5 - (a + 0.5) % 1
return ((r&0x0ff)<<0x00)|((g&0x0ff)<<0x08)|((b&0x0ff)<<0x10)|((a&0x0ff)<<0x18)
end