Copy link to clipboard
Copied
Bonjour,
j'ai utilisé une expression pour un random color sur des couleurs de pixel avec un color control mais cela me créer des transitions entre les couleur. Je souhaite avoir les bonnes couleurs directement les unes après les autres sans passé par un dégradé.
Quelqu'un sait comment faire ?
Merci 🙂
There are a number of possibilities. This one would randomly select from a list of colors every 0.5 seconds:
colors = [[1,.5,0,1],[1,1,0,1],[1,0,0,1],[.5,0,1,1],[1,0,1,1]]; // orange, yellow, red, purple, magenta
dur = .5; // duration of each color (seconds)
seed = Math.floor((time - inPoint)/dur);
seedRandom(seed,true);
colors[Math.floor(random(colors.length))]
and this one just selects a random color every 0.5 seconds:
dur = .5; // duration of each color (seconds)
seed = Math.floor((time - in
...
Copy link to clipboard
Copied
Can you post the expression you've used? And maybe a screenshot of the current result and a mockup of the result you're trying to achieve? I think that would help us answer your question.
Copy link to clipboard
Copied
Without knowing what expression you used we cannot tell you much. Simply sounds like you are using a "dumb" random function that doesn't quantize the colors or picks them from an array. Of course then there's always the chance the function will just pick undesirable inbetween colors. Anyway, provide the code and explain what you exactly need.
Mylenium
Copy link to clipboard
Copied
There are a number of possibilities. This one would randomly select from a list of colors every 0.5 seconds:
colors = [[1,.5,0,1],[1,1,0,1],[1,0,0,1],[.5,0,1,1],[1,0,1,1]]; // orange, yellow, red, purple, magenta
dur = .5; // duration of each color (seconds)
seed = Math.floor((time - inPoint)/dur);
seedRandom(seed,true);
colors[Math.floor(random(colors.length))]
and this one just selects a random color every 0.5 seconds:
dur = .5; // duration of each color (seconds)
seed = Math.floor((time - inPoint)/dur);
seedRandom(seed,true);
random([0,0,0,1],[1,1,1,1])
Copy link to clipboard
Copied
thank you ! exactly what i want !