Skip to content

Instantly share code, notes, and snippets.

@rdaniel0
rdaniel0 / colorTransition.lua
Last active July 23, 2020 12:33
A colour transition function for CoronaSDK in lua
function TransitionColor(displayObj, params)
if(params and params.startColor and params.endColor) then
local length = params.time or 300
local startTime = system.getTimer()
local easingFunc = params.transition or easing.linear
local function colorInterpolate(a,b,i,t)
colourTable = {
easingFunc(i,t,a[1],b[1]-a[1]),