From 3b0ee59f472e2c56057a37488cd06bae819a7548 Mon Sep 17 00:00:00 2001 From: zomo Date: Wed, 23 Jun 2021 14:15:51 -0500 Subject: [PATCH] updated example --- examples/rgba.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/rgba.lua b/examples/rgba.lua index b9c3d94..615a9f2 100644 --- a/examples/rgba.lua +++ b/examples/rgba.lua @@ -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 \ No newline at end of file