#1659·sioyek

[bug] when blue light filtering is on sioyek highlight colors are distinguishable, but underline colors are not

Author: SuperCowProductsCreated Jul 31, 2026Updated Sep 14, 2026

Setup

prefs_user.config

add_highlight(E) e
add_highlight(e) E

keys_user.config

highlight_color_e #008000

Notes

I updated to latest dev of wlroots and sway, as today a patch to make gamma change (AKA 'night light' / blue light filter) work on Asahi Linux (which only works software-side) was merged. I am starting sway with WLR_RENDERER=vulkan for this to work. I used gammastep -v -PO 4000 once to change the gamma, and this persists across sessions (no running gammastep processes, as pgrep gamma doesn't return anything).

Reproduce

If you zoom out the colors of underlines are correct, but if you zoom in some colors are filled with gray and only there outline is of the correct color.

Original

Trying to highlight with green, it will be easy to tell regardless of the gamma level: when underlining though, it is so washed out it looks like gray unless you zoom right in and turn the display brightness right up, and then you can just about tell it's green. Also worth noting dark or light mode doesn't really make a difference.

Idea

The easiest fix I can imagine is allowing a way for underline annotation colors to render in the exact same way highlight annotation colors do. If that happens the underlines will definitely be distinguishable!

Original

For it to work I had to set export WLR_RENDERER=vulkan in ~/.config/bash_profile.

After I run exec gammastep -v -PO 4000, even if I run exec gammastep -v -PO 6500 the underline which should be green stays gray.

It's worth noting this does not happen with green highlights!

Experiment

1

I tried building with the following patch:

patch
diff --git a/pdf_viewer/pdf_view_opengl_widget.cpp b/pdf_viewer/pdf_view_opengl_widget.cpp
index 82609f0f..4fddc049 100644
--- a/pdf_viewer/pdf_view_opengl_widget.cpp
+++ b/pdf_viewer/pdf_view_opengl_widget.cpp
@@ -617,7 +617,7 @@ void PdfViewOpenGLWidget::render_highlight_window(GLuint program, NormalizedWind
         glDrawArrays(GL_LINE_LOOP, 0, 4);
     }
     if (flags & HRF_UNDERLINE) {
-        glDisable(GL_BLEND);
+        // glDisable(GL_BLEND);
         glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
     }

Curiously, the colors are visible this way. It's hard to tell the difference between red and pink, and blue is hard to see, but a lot better than just seeing a lot of gray! In light mode they are very easy to tell apart, so it's definitely the dark mode shader causing this.

2

With

patch
diff --git a/pdf_viewer/pdf_view_opengl_widget.cpp b/pdf_viewer/pdf_view_opengl_widget.cpp
index 82609f0f..75012744 100644
--- a/pdf_viewer/pdf_view_opengl_widget.cpp
+++ b/pdf_viewer/pdf_view_opengl_widget.cpp
@@ -617,7 +617,9 @@ void PdfViewOpenGLWidget::render_highlight_window(GLuint program, NormalizedWind
         glDrawArrays(GL_LINE_LOOP, 0, 4);
     }
     if (flags & HRF_UNDERLINE) {
-        glDisable(GL_BLEND);
+        // glDisable(GL_BLEND);
+        glEnable(GL_BLEND);
+        glBlendFunc(GL_ONE,GL_ZERO);
         glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
     }

Pink, yellow and blue have good visibility, but orange is filled with yellow, and purple and green are filled with gray. Note the borders of orange, purple and green use the correct color.

3

With

patch
diff --git a/pdf_viewer/pdf_view_opengl_widget.cpp b/pdf_viewer/pdf_view_opengl_widget.cpp
index 82609f0f..7305d8ea 100644
--- a/pdf_viewer/pdf_view_opengl_widget.cpp
+++ b/pdf_viewer/pdf_view_opengl_widget.cpp
@@ -617,7 +617,9 @@ void PdfViewOpenGLWidget::render_highlight_window(GLuint program, NormalizedWind
         glDrawArrays(GL_LINE_LOOP, 0, 4);
     }
     if (flags & HRF_UNDERLINE) {
-        glDisable(GL_BLEND);
+        // glDisable(GL_BLEND);
+        glEnable(GL_BLEND);
+        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
         glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
     }

a tiny bit brighter in dark mode, but in light mode colors are all washed out.