added example

This commit is contained in:
2021-06-23 13:58:11 -05:00
parent c347a4fd6e
commit 13705aa0bd
2 changed files with 64 additions and 17 deletions

6
examples/rgba.lua Normal file
View File

@@ -0,0 +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)
end