mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Pre-computed powers of two in lume.rgba
This commit is contained in:
parent
1a82d308af
commit
6b73aaa8ad
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
|
||||
|
Loading…
Reference in New Issue
Block a user