Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to constantly change color of a spectrum

  • Expression to constantly change color of a spectrum

    Posted by Mario Pascal on March 22, 2017 at 2:03 am

    Hi,
    I’m running a music channel where I upload music regularly, and I need an expression for the color effects on my audio spectrum layer (Inside Color/Outside color)
    Basically, I need a way to keep this spectrum constantly changing in a rainbow form, if not I can put in my own colors if needed, if you don’t understand what I mean look at the spectrum at the back of the black spectrum, I need an expression that can do that. https://youtu.be/ZaViSUC6mnQ
    Thanks In advance!

    Mario Pascal replied 9 years, 1 month ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    March 22, 2017 at 6:04 pm

    This might be a place to start:

    hues = [0,30,60,120,180,240,300];
    freq = 1;
    idx = Math.floor(time*freq)%hues.length;
    hslToRgb([hues[idx]/360,.85,.4,1])

    Dan

  • Mario Pascal

    March 23, 2017 at 12:41 am

    Yes, it’s something like how I want it to be.. Thanks alot! But question.. is there a way to modify the expression to make it change a little slower?

  • Dan Ebberts

    March 23, 2017 at 12:50 am

    To make it go half as fast, change this line:

    freq = 1;

    to this:

    freq = .5;

    Dan

  • Mario Pascal

    March 29, 2017 at 6:20 pm

    Isn’t there a way to make the colors smoothly blend?

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy