Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

random couleur expression

New Here ,
Nov 23, 2022 Nov 23, 2022

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 🙂

TOPICS
Expressions , Freeze or hang , Scripting
999
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 23, 2022 Nov 23, 2022

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
...
Translate
Community Expert ,
Nov 23, 2022 Nov 23, 2022

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 23, 2022 Nov 23, 2022

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 23, 2022 Nov 23, 2022

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])

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 23, 2022 Nov 23, 2022
LATEST

thank you ! exactly what i want !

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines