]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_lamp/commitdiff
Fixed redrawing when the color changes for heartstream
authorRachael <srbennett@gmail.com>
Sun, 8 Apr 2018 06:22:01 +0000 (23:22 -0700)
committerRachael <srbennett@gmail.com>
Sun, 8 Apr 2018 06:22:01 +0000 (23:22 -0700)
draw-heartstream.lua

index 08c287540b74f5e342462ea5fc97e72a79d78c16..377ebef58c859f076f81b2ee5821774ebafb18c4 100644 (file)
@@ -1,8 +1,13 @@
 return function(t,fb,p)
-  local c = p[1]
-  local c2 = p[2] or c
+  local c, c2
   local z = string.char(0,0,0)
 
+  local function reinit()
+     c = p[1]
+     c2 = p[2] or c
+  end
+  reinit()
+
   local s = {}
   local b = {}
 
@@ -52,5 +57,6 @@ return function(t,fb,p)
     dodraw()
   end)
 
-  return { ['ncolors'] = 2 }
+--local hixp for hixp = 1,hix do ht[hixp]() end; local fixp for fixp=1,fix do ft[fixp]() end;
+  return { ['ncolors'] = 2, ['cccb'] = function() reinit();  local fixp for fixp=1,fix do ft[fixp]() end; dodraw() end }
 end