From f7af3ea9acc36f565a2445e923f8d7efe8c6483d Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Mon, 25 May 2026 09:08:42 +0200 Subject: [PATCH] Force the text selection color to be in light mode Most of the pdfs have a white background, so it makes sense to use the colors for light mode. --- src/display/filter_factory.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/display/filter_factory.js b/src/display/filter_factory.js index f39edfade..430cb697e 100644 --- a/src/display/filter_factory.js +++ b/src/display/filter_factory.js @@ -132,6 +132,9 @@ class DOMFilterFactory extends BaseFilterFactory { if (!this.#_defs) { const div = this.#document.createElement("div"); const { style } = div; + // The pdf colors are mostly in light mode (white background with a black + // foreground), so the filters are created in light mode. + style.colorScheme = "only light"; style.visibility = "hidden"; style.contain = "strict"; style.width = style.height = 0;