On a black-on-white PDF document, if I use the "Text Selection Tool" to generate a selection, it looks like the highlight background color (I guess it is blue by default) is used, but not the highlight foreground color (both "kdiff3" and "kate" seem to use white), which makes the selection unintelligible. Okular's own https://okular.kde.org/images/screenies/okular-backend-pdf-1.png and https://okular.kde.org/images/screenies/okular-textselection.png show this. Reproducible: Always Steps to Reproduce: 1. Open a PDF document. 2. Tool -> Text Selection Tool. 3. Click-and-drag to generate a selection. Actual Results: Okular highlights the selection with black-on-blue. Expected Results: White-on-blue selection.
Using the selection text color from the theme would definitely work, but might look ugly, like we're mangling the presentation of the document. Maybe instead when the text is dark, we could impose a certain amount of lightness on the selection background, to ensure that it's always readable.
Can confirm this on Okular 1.9.0. Any progress on this bug?
The problem persists on Okular 1.9.3. Any progress on this issue?
>Using the selection text color from the theme would definitely work, but might look ugly, like we're mangling the presentation of the document. Maybe instead when the text is dark, we could impose a certain amount of lightness on the selection background, to ensure that it's always readable. Well, with a dark selection color it's not just ugly but partly to completely unreadable. Perhaps making the selection color transparent with the background could ensure a certain contrast while still retaining the original text color though?
I submitted a tentative merge request to address this issue: https://invent.kde.org/graphics/okular/-/merge_requests/440 Maybe someone here could help review it?
Created attachment 159260 [details] The Breath Dark theme's color on a PDF with white background and black text
I think this is the right thread. I am using Breath Dark theme on my Plasma and the selection theme works pretty fine everywhere that has a dark background (Dolphine, Plasma Settings, Kate, ...) , and also due to color inversion, it works fine in kdiff3 which has white background. I checked the https://invent.kde.org/graphics/okular/-/merge_requests/440 but saw that it was closed without explanation/conclusion. I tried to experiment with the color schemes and finally managed to find the right balance, but I think the most ideal situation is to either have a configurable selection color (perhaps the easiest), or similar to kdiff, the text color gets inverted if there is not enough contrast between the highlight color and the text color. In case it matters, here is my system info: - Okular Version: 23.04.0 - Operating System: Manjaro Linux - KDE Plasma Version: 5.27.4 - KDE Frameworks Version: 5.105.0 - Qt Version: 5.15.9 - Kernel Version: 6.1.26-1-MANJARO (64-bit) - Graphics Platform: X11 - Processors: 20 × Intel® Core™ i9-10900K CPU @ 3.70GHz - Memory: 31.1 GiB of RAM - Graphics Processor: AMD Radeon Pro WX 3200 Series