简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM