futurepress / epub.js

Enhanced eBooks in the browser.
http://futurepress.org
Other
6.42k stars 1.1k forks source link

Unable to change the underline color #1342

Open SamuelPremji opened 1 year ago

SamuelPremji commented 1 year ago

By default the underline color is grey. I know how to change the highlight color but for underline it does not work. Anyone knows?

Here's how I did it for changing the highlight color:

rendition.annotations.add("highlight", cfiRange, {}, (e) => {console.log("highlight clicked", e.target);} , "hl", {"fill": "green", "fill-opacity": "0.5", "mix-blend-mode": "multiply"})

victorsoares96 commented 6 months ago

This is a problem caused by the library used by epub.js called marks-pane

There has been a pull request open to fix this issue for a few months https://github.com/fchasen/marks/pull/6

victorsoares96 commented 6 months ago

I posted the suggested fix in the pull request if you want to use it

https://www.npmjs.com/package/@victorsoares96/epubjs

npm i @victorsoares96/epubjs