javascriptreact-nativeepub.js

I can't customize the highlight color in epubjs-rn


I am using epubjs-rn and i wanted to select a color for highlighting a text .

I was searching in the docs and i found this code but it didn't work .

onSelected={(cfiRange, rendition) => {
  rendition.highlight(cfiRange, {}, (e) => {console.log(e)}, undefined, {fill: 'blue'});
}}

Any help will be appreciated .


Solution

  • you should use fill parameter like this , that's work correctly :)

    rendition.highlight(mcfi, {}, (e) => { console.log(e) }, undefined, { 'fill': 'gold' });