-
Array, color and looping
Hello everyone!
Been searching for a way to solve this problem for a while now and I just can’t find anything.
For the video I’m working on, there will be a series of spotlights that have to change colour fairly rapidly while they move. So I found this script in a tutorial and showed a short render to the project team.
posterizeTime(4);
var color1 = [0,0,0,0];
var color2 = [1,1,1,1];
random(color1,color2)It works but when they saw it, they said the colours were “too random” and they want a range of certain colours. So now I have 2 problems, it has to be #OnlyTheseColours and looping or pingpong smoothly back and forth. It can’t just go from one colour to the other one time. And of course loopOut() only works with keyframes drat it all.
So I found something that talked about “linear” and that does not work, it picks a percentage (sort of) amount between 2 array items.
var color1 = comp(“XControl”).layer(“AAA”).effect(“White”)(“Color”);
var color2 = comp(“XControl”).layer(“AAA”).effect(“Orange”)(“Color”);
var color3 = comp(“XControl”).layer(“AAA”).effect(“Green”)(“Color”);linear(.8,color1,color3) <– .8 is not time here but a value amount
Is there an expression that would cover this? At this point, I have only one spotlight in the composition but there has to be more and I’d like to nail this down before I make more of them. Unfortunately, it will need to be flexible. I thought expressions would be the way to do it, but maybe I need to try plugins as the clock is ticking.
At this point, there hasn’t been any question about amount of time for the colour changes, which is another reason why I was trying this with my very limited expressions knowledge. It would be easier to change if I get a “slow it down” or “speed it up”. I think I’ll try a plugin colour cycle and see how that goes.
thank you for your help 🙂