-
fade-in/out color based on input values
Hi there! I have two instances of a text layer’s Tint Effect being colored based on user-input values. So there’s ‘fade’ in/out of the color blue. Everything works except for the 2nd round of variables appended with a ‘2’
var cti = timeToFrames(); var tli = thisComp.layer("Controller").effect("TarLight 1 on")("Slider") var tlo = thisComp.layer("Controller").effect("TarLight 1 off")("Slider") var tli2 = thisComp.layer("Controller").effect("TarLight 2 on")("Slider") var tlo2 = thisComp.layer("Controller").effect("TarLight 2 off")("Slider") var frames = 1 / thisComp.frameDuration; var fadeTime = thisComp.layer(1).effect("Fade Time")("Slider") / frames; var st = tli / frames; var et = tlo / frames; var st2 = tli2 /frames; var et2 = tlo2 /frames; gray = [99, 102, 106, 255]/255 blue = [3, 169, 244, 255]/255 if ((cti >= tli && cti <= tlo) || (cti >= tli2 && cti <= tlo2)) {blue} else if (cti < tli) { ease(time, st, st - fadeTime, gray, blue) } else if (cti > tlo) { ease(time, et, et + fadeTime, blue, gray) } else if (cti < tli2) { ease(time, st2, st2 - fadeTime, gray, blue) } else if (cti > tlo2) { ease(time, et2, et2 + fadeTime, blue, gray) } else {gray}the 2nd round of ‘else if’s’ don’t do the fade and I’m wondering if there’s a better way to order this or if I’m out of luck.