diff --git a/displayword.lua b/displayword.lua index 58752c9..04bfde2 100644 --- a/displayword.lua +++ b/displayword.lua @@ -3,20 +3,20 @@ local M do local updateColor = function (data) if (data.amountOfChars > 0) then - local div = tonumber(data.drawnCharacters/data.amountOfChars) - if (div < 1) then - return data.colorFg - elseif (div < 2) then - return data.colorMin1 - elseif (div < 3) then - return data.colorMin2 - elseif (div < 4) then - return data.colorMin3 - elseif (div < 5) then - return data.colorMin4 - else - return data.colorFg - end + local div = tonumber(data.drawnCharacters/data.amountOfChars) + if (div < 1) then + return data.colorFg + elseif (div < 2) then + return data.colorMin1 + elseif (div < 3) then + return data.colorMin2 + elseif (div < 4) then + return data.colorMin3 + elseif (div < 5) then + return data.colorMin4 + else + return data.colorFg + end else return data.colorFg end diff --git a/main.lua b/main.lua index bc1de9a..81ce2c4 100644 --- a/main.lua +++ b/main.lua @@ -72,9 +72,9 @@ function displayTime() invertRows=true end displayword.generateLEDs(words, color, color1, color2, color3, color4, invertRows) - if (displayword.data.drawnCharacters ~= nil) then + if (displayword.data.drawnCharacters ~= nil) then ledBuf = displayword.generateLEDs(words, color, color1, color2, color3, color4, invertRows, displayword.data.drawnCharacters) - end + end end displayword = nil if (ledBuf ~= nil) then diff --git a/wordclock.lua b/wordclock.lua index ef3136e..0228c51 100755 --- a/wordclock.lua +++ b/wordclock.lua @@ -64,7 +64,7 @@ function display_timestat(hours, minutes, longmode) ret.before=1 elseif (minutes==9) then -- Hande if three quater or quater before is displayed - if (threequater ~= nil) then + if ((threequater ~= nil) and (threequater==true or threequater=="on")) then ret.threequater=1 else ret.quater = 1