diff options
| -rw-r--r-- | ui.lua | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1,4 +1,9 @@ -local bit32 = require("bit32") +local ok, bit = pcall(require, "bit") +if not ok then + ok, bit = pcall(require, "bit32") + if not ok then error("no bit library") end +end + local utf8 = require("utf8") local distribute = require("distribute") @@ -255,9 +260,9 @@ end local function color(hex) return { love.math.colorFromBytes( - bit32.band(bit32.rshift(hex, 16), 0xff), - bit32.band(bit32.rshift(hex, 8), 0xff), - bit32.band(bit32.rshift(hex, 0), 0xff) + bit.band(bit.rshift(hex, 16), 0xff), + bit.band(bit.rshift(hex, 8), 0xff), + bit.band(bit.rshift(hex, 0), 0xff) ) } end |
