Skip to main content
Known Participant
August 25, 2017
Question

specify color

  • August 25, 2017
  • 1 reply
  • 409 views

Hi,

I want to change the color of the highlight color and found this script, but the only colors I get to display are the ugly yellow, green, blue and white. What is the correct way of adding f.e. rgba(,244, 109, 45, 0.5) instead of yellow?

app.runtimeHighlight = true;app.runtimeHighlightColor = color.yellow;

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 25, 2017

You should read up on the Color object... It's basically an array of a string and then some numbers.

For example, to specify an RGB value (RBGA is not possible) of 244, 109, 45 you would use:

app.runtimeHighlightColor = ["RGB", 244/255, 109/255, 45/255];

Notice the values are between 0 and 1, which is why I divided the numbers you provided (which I assume are between 0 and 255) by 255, to bring them to the correct model.

Known Participant
August 25, 2017

Cool! You saved my day again

Yes, I should read up to the color object, it's different thinking.... I have been searching how color is coded in Java, but couldn't find clear documentation. Can you advise on a doc for dummies?

Thanks!

Joel Geraci
Community Expert
Community Expert
August 26, 2017

JavaScript... not Java. I know it seems pedantic but Google is pedantic.

Here's a link to the documentation for the Acrobat JavaScript color object.

Acrobat DC SDK Documentation