Dev.to WebDev 🛠 Dev 👁 0 📖 2 min read

I made a PDF dark mode that doesn't turn photos into negatives

I read a lot of PDFs, and most dark mode extensions do the same thing: invert everything. Text goes white on black, which is fine. But every photo, chart and cover turns into a negative, and anything with colour in it be

I read a lot of PDFs, and most dark mode extensions do the same thing: invert everything. Text goes white on black, which is fine. But every photo, chart and cover turns into a negative, and anything with colour in it becomes hard to read.

So I built Candlepage. It darkens the pages but leaves pictures, charts and colourful slides in their own colours. Plain black-and-white drawings and scans still get inverted so they stay readable. There's a switch for pictures (off, auto, all), and if you want to see the page as printed, you hold Alt+O and let go to go back.

A few other things it does:

  • Brightness, contrast and sepia controls, and you can pick the background around the pages
  • Shows the real printed page numbers instead of the PDF's internal ones
  • Works on PDFs opened from websites, not only local files (for local files you need to turn on "Allow access to file URLs" in the extension settings)
  • English and Hebrew, including right-to-left, since I build a lot of Hebrew UIs
  • Optional library, reading history and some math tools. These are all off until you turn them on

On privacy: your PDFs stay in the browser and aren't uploaded. There are no ads and no analytics. The only thing that can leave is an optional report when something looks wrong, and it only goes out if you press send or turn on automatic reports. It never includes the PDF or its text.

I'm in the middle of replacing the colour engine. The current one inverts the finished page. The new one colours each page as it's drawn, which should handle slides and infographics better. It's not out yet, and there's a button to go back to the classic mode.

It's free. The Chrome version is here: https://chromewebstore.google.com/detail/candlepage-pdf-dark-mode/dppgdlndkhpjjljmjlllmpefibbihilb and there's a short page at https://mrsshh.github.io/candlepage/. The Edge version is in review.

If you read PDFs at night and something looks wrong, tell me. I'd like to know which kinds of files break it.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.