Replaced use of lume.rgba() with lume.color()

This commit is contained in:
rxi
2018-03-15 19:17:58 +00:00
parent 2da9d443f5
commit 110d66a413

View File

@@ -121,26 +121,36 @@ function lurker.onerror(e, nostacktrace)
local stacktrace = nostacktrace and "" or
lume.trim((debug.traceback("", 2):gsub("\t", "")))
local msg = lume.format("{1}\n\n{2}", {e, stacktrace})
local colors = { 0xFF1E1E2C, 0xFFF0A3A3, 0xFF92B5B0, 0xFF66666A, 0xFFCDCDCD }
local colors = {
{ lume.color("#1e1e2c", 256) },
{ lume.color("#f0a3a3", 256) },
{ lume.color("#92b5b0", 256) },
{ lume.color("#66666a", 256) },
{ lume.color("#cdcdcd", 256) },
}
love.graphics.reset()
love.graphics.setFont(love.graphics.newFont(12))
love.draw = function()
local pad = 25
local width = love.graphics.getWidth()
local function drawhr(pos, color1, color2)
local animpos = lume.smooth(pad, width - pad - 8, lume.pingpong(time()))
if color1 then love.graphics.setColor(lume.rgba(color1)) end
if color1 then love.graphics.setColor(color1) end
love.graphics.rectangle("fill", pad, pos, width - pad*2, 1)
if color2 then love.graphics.setColor(lume.rgba(color2)) end
if color2 then love.graphics.setColor(color2) end
love.graphics.rectangle("fill", animpos, pos, 8, 1)
end
local function drawtext(str, x, y, color, limit)
love.graphics.setColor(lume.rgba(color))
love.graphics.setColor(color)
love.graphics[limit and "printf" or "print"](str, x, y, limit)
end
love.graphics.setBackgroundColor(lume.rgba(colors[1]))
love.graphics.setBackgroundColor(colors[1])
love.graphics.clear()
drawtext("An error has occurred", pad, pad, colors[2])
drawtext("lurker", width - love.graphics.getFont():getWidth("lurker") -
pad, pad, colors[4])
@@ -149,6 +159,7 @@ function lurker.onerror(e, nostacktrace)
"resume", pad, pad + 46, colors[3])
drawhr(pad + 72, colors[4], colors[5])
drawtext(msg, pad, pad + 90, colors[5], width - pad * 2)
love.graphics.reset()
end
end