Skip to main content
TechOff
Participant
Feb 20, 2026 5:09 PM UTC
Answered

JavaScript help for adding RGB colours

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!

    ls_rbls
    ls_rblsCorrect answer
    Community Expert
    Feb 21, 2026 12:04 PM UTC

    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

    Technical Generalist

    3 replies

    ls_rbls
    Community Expert
    ls_rblsCommunity ExpertCorrect answer
    Community Expert
    Feb 21, 2026 12:04 PM UTC

    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

    Translate
    Technical Generalist
    TechOff
    TechOffAuthor
    Participant
    Feb 24, 2026 8:01 PM UTC

    Perfection!! Thank you!!!

    Translate
    ls_rbls
    Community Expert
    Community Expert
    Feb 26, 2026 5:05 AM UTC

    You’re welcome.

    Translate
    Technical Generalist