Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

specify color

Explorer ,
Aug 25, 2017 Aug 25, 2017

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;

TOPICS
Acrobat SDK and JavaScript , Windows
302
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 25, 2017 Aug 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 25, 2017 Aug 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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 25, 2017 Aug 25, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 26, 2017 Aug 26, 2017
LATEST

Thanks, Joel

That doc makes perfect sense

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines