From e985d5c8ea72c934582458015f2de66465baaac9 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Mon, 20 Nov 2017 03:18:58 -0500 Subject: [PATCH] heartbeat: multi-color support --- draw-heartbeat.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/draw-heartbeat.lua b/draw-heartbeat.lua index 50a5098..845fd7a 100644 --- a/draw-heartbeat.lua +++ b/draw-heartbeat.lua @@ -1,9 +1,11 @@ return function(t,fb,p) local c = p[1] - local ft = { [1] = function() fb:set(11,c) fb:set(13,c) end, -- side chambers - [2] = function() fb:set(11,0,0,0) fb:set(20,c) fb:set(13,0,0,0) end, -- bottom chamber - [3] = function() fb:set(20,0,0,0) end, -- empty - [4] = function() end -- stay empty + local c2 = p[2] or c + local z = string.char(0,0,0) + local ft = { [1] = function() fb:set(11,c2) fb:set(13,c2) end, -- side chambers + [2] = function() fb:set(11,z) fb:set(20,c2) fb:set(13,z) end, -- bottom chamber + [3] = function() fb:set(20,z) end, -- empty + [4] = function() end -- stay empty } fb:fill(0,0,0) -- 2.50.1