0

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 .

Mahdi
  • 1,355
  • 1
  • 12
  • 28

2 Answers2

2

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

rendition.highlight(mcfi, {}, (e) => { console.log(e) }, undefined, { 'fill': 'gold' });
Meisan Saba
  • 800
  • 2
  • 9
  • 25
  • 1
    Thanks Meisam, this issue forced me to send a pull request to the `epubjs-rn` and that solved the problem :) – Mahdi Aug 28 '20 at 17:07
0

I think, you should set 'background: blue' instead of fill: blue

Ori Idan
  • 153
  • 1
  • 9