Skip to main content
TechOff
Participant
February 20, 2026
Question

JavaScript help for adding RGB colours

  • February 20, 2026
  • 1 reply
  • 15 views

I have a drop down menu of options where the background colour changes based on the choice picked. I’ve added a custom validation script (below) but it seems that Adobe isn’t recognizing the colour orange (displays it as the same yellow as the “yellow” colour in the javascript), so I want to use the RGB colour codes instead but have not had much success.

Here’s the script:

if (event.value=="CHOOSE FROM LIST:")event.target.fillColor=color.white;

if (event.value=="MONITORING")event.target.fillColor=color.green;

else if (event.value=="ENHANCED MONITORING")event.target.fillColor=color.yellow;

else if (event.value=="PARTIAL ACTIVATION") event.target.fillColor=color.orange;

else if (event.value=="FULL ACTIVATION") event.target.fillColor=color.red;

 

Any assistance is appreciated!

    1 reply

    ls_rbls
    Community Expert
    Community Expert
    February 21, 2026

    Hi ​@TechOff ,

     

    See if this helps :

     

    /*

    color.orange = ["RGB", 1, 0.5, 0];

    */


    if (event.value=="CHOOSE FROM LIST:") event.target.fillColor = color.white;

    else if (event.value=="MONITORING") event.target.fillColor = color.green;

    else if (event.value=="ENHANCED MONITORING") event.target.fillColor = color.yellow;

    else if (event.value=="PARTIAL ACTIVATION") event.target.fillColor = ["RGB", 1, 0.5, 0];

    else if (event.value=="FULL ACTIVATION") event.target.fillColor = color.red;

     

    ** due credit with AI assistance... I haven't tested this but hopefully it helps