Skip to main content
Participant
January 10, 2022
Answered

Javascript Expression color change

  • January 10, 2022
  • 1 reply
  • 417 views

Here is my example in extend script:

controller = thisComp.layer("controller").effect("color")("Menü");
oxford_blue = hexToRgb("072555");
white = hexToRgb("ffffff");

if (controller == 1) oxford_blue else
if (controller == 2) white else oxford_blue

 

How would you write this as a javascript expression?

This topic has been closed for replies.
Correct answer Akira Endo

Hi,

it's already pretty much the same:

controller = thisComp.layer("controller").effect("choose Color")("Menu");
oxford_blue = hexToRgb("072555");
white = hexToRgb("ffffff");
if(controller == 1){
     oxford_blue;} 
else {
     white;}
Cheers,
Akira

1 reply

Akira EndoCorrect answer
Participating Frequently
January 10, 2022

Hi,

it's already pretty much the same:

controller = thisComp.layer("controller").effect("choose Color")("Menu");
oxford_blue = hexToRgb("072555");
white = hexToRgb("ffffff");
if(controller == 1){
     oxford_blue;} 
else {
     white;}
Cheers,
Akira
SatyrosAuthor
Participant
January 11, 2022

Thank you!