user6075571
user6075571

Reputation: 11

how can i change highlight color in mupdf library android

My project is using mupdf for android.I am not able to change color of highlighted text.Anyone who can help me. Thank you in advance.

Upvotes: 0

Views: 895

Answers (1)

Ramesh R
Ramesh R

Reputation: 329

In Mupdf library they have used some default color for highlight as below

 color[0] = 1.0;
 color[1] = 1.0;
 color[2] = 0.0;

To change the color dynamically, You can pass the integer color value as a parameter to the corresponding method and assign it like below.

color[0] = ((intcolor >> 16) & 0xFF) / 255.0;  // Extract the RR byte
color[1] = ((intcolor >> 8) & 0xFF) / 255.0;   // Extract the GG byte
color[2] = (intcolor & 0xFF) / 255.0; // Extract the BB byte

Upvotes: 3

Related Questions