specify color

Community Beginner ,
Aug 25, 2017

Copy link to clipboard

Copied

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

Views

110

Likes

Translate

Translate

Report

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

specify color

Community Beginner ,
Aug 25, 2017

Copy link to clipboard

Copied

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

Views

111

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 25, 2017 0
Most Valuable Participant ,
Aug 25, 2017

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 25, 2017 0
Community Beginner ,
Aug 25, 2017

Copy link to clipboard

Copied

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!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 25, 2017 0
Adobe Community Professional ,
Aug 25, 2017

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 25, 2017 0
Community Beginner ,
Aug 26, 2017

Copy link to clipboard

Copied

Thanks, Joel

That doc makes perfect sense

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 26, 2017 0