-
How to change random colors gradually?
I’ve found this great rig for randomizing preset colors.
It’s made by Andrew Marston of Ukramedia and it works perfectly.The only trouble with this rig is that it doesn’t blend the colors from one color to another.
Is there a simple solution to gradually change to another random color?The code is down below. The first is the more elaborate version of the code. At the bottom is a simplified (and less flexible) version.
The Youtube video which explains the build is found here:
https://www.youtube.com/watch?v=yIaARyBthBs
colors = new Array();
numColors = thisComp.layer("Ctrl").effect("numColors")("Slider");
for(i = 1; i <= numColors; i++){
newColor = thisComp.layer("Ctrl").effect("Color Control " + i)("Color");
colors.push(newColor);
}
slider = thisComp.layer("Ctrl").effect("Freq")("Slider").value;
counter = Math.floor(time/slider);
seedRandom(counter, true);
colorId = Math.floor(random(colors.length));
colors[colorId];
color1 = thisComp.layer("Ctrl").effect("Color Control 1")("Color");
color2 = thisComp.layer("Ctrl").effect("Color Control 2")("Color");
color3 = thisComp.layer("Ctrl").effect("Color Control 3")("Color");
color4 = thisComp.layer("Ctrl").effect("Color Control 4")("Color");
colors = [color1, color2, color3, color4];
freq = thisComp.layer("Ctrl").effect("Freq")("Slider");
counter = Math.floor(time/freq);
seedRandom(counter, true);
colorId = Math.floor(random(colors.length));
colors[colorId];
Some contents or functionalities here are not available due to your cookie preferences!This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.