Closed ericpa06 closed 2 years ago
Selection highlighters like the findbar's are implemented in C++ so autoconfig scripts can't do anything to change their behavior. The highlighter is performing calculations to find the contrast between the highlight background color and the background color of the content it's being drawn on. So that's why it's inverting the colors. Anyway, the highlighters use the look-and-feel color system, which can be configured by preferences. If you look in my readme there's a list of recommended settings. It includes selection color settings, the ones that start with ui
. If you configure them correctly, the colors will never invert.
It's hard to explain how it works, but it seems to compare the colors as background/foreground layers. So, the way I've done this is to use a color of medium brightness for all the background prefs and white for all the foreground prefs. That way I always get the same colors. However, I'm not sure if you can replace white with black and still get that consistent behavior. If I'm remembering correctly, I think if you use black on ~50% brightness, there's a potential for it to basically flip the layers. I could be wrong though, I haven't looked closely at the source code for this. But I prefer white text anyway, since I use dark reader.
You can offer your feedback in this bug though
Thanks.
I was wondering if there is any way to make the highlighted text cohesive and to always use to the same color no matter what, like it works on other browsers? As always, thank you very much and sorry to bother.