mirror of
https://github.com/TangentFoxy/lume.git
synced 2025-07-28 11:02:20 +00:00
Pre-computed powers of two in lume.rgba
This commit is contained in:
6
lume.lua
6
lume.lua
@@ -435,9 +435,9 @@ end
|
||||
|
||||
|
||||
function lume.rgba(color)
|
||||
local a = math_floor((color / 2 ^ 24) % 256)
|
||||
local r = math_floor((color / 2 ^ 16) % 256)
|
||||
local g = math_floor((color / 2 ^ 08) % 256)
|
||||
local a = math_floor((color / 16777216) % 256)
|
||||
local r = math_floor((color / 65536) % 256)
|
||||
local g = math_floor((color / 256) % 256)
|
||||
local b = math_floor((color) % 256)
|
||||
return r, g, b, a
|
||||
end
|
||||
|
Reference in New Issue
Block a user