Of course, it naturally lead to me trying to do the same in Elm!
To translate the approach was really straight forward, though there are some minor differences, e.g. alpha values in Elm are between 0 to 1 but 0 to 255 in Lua.
The code is available on github, feel free to poke around.
Here are two variations in action:
Subscribe to my newsletter and get new contents delivered straight to your inbox :-)