commit 38e6901e4e84da1c6874e2d3f1ad7a442f82dd51
Author: Koji Yokota <[email protected]>
Date:   Thu Oct 1 16:43:45 2026 +0900

    Fix #13371 (Dark font color in dark mode of non-default themes)
    
    Thanks to Pavel!
---
 src/frontends/qt/ColorCache.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/frontends/qt/ColorCache.cpp b/src/frontends/qt/ColorCache.cpp
index 558774b9b7..f4c86662d9 100644
--- a/src/frontends/qt/ColorCache.cpp
+++ b/src/frontends/qt/ColorCache.cpp
@@ -231,13 +231,13 @@ ARGBColor ColorCache::colorOverlay(ARGBColor const & fg, 
ARGBColor const & bg)
 {
        int red, green, blue, alpha;
 
-       auto fg_weight = fg.a;
-       auto bg_weight = 1 - fg.a;
+       float const fg_weight = fg.a/255.0;
+       float const bg_weight = 1 - fg.a/255.0;
 
-       red   = std::round((fg_weight * fg.r + bg_weight * bg.r) * 255);
-       green = std::round((fg_weight * fg.g + bg_weight * bg.g) * 255);
-       blue  = std::round((fg_weight*fg.b  + bg_weight * bg.b) * 255);
-       alpha = std::round((1 - (1 - fg.a) * (1 - bg.a) * 255));
+       red   = std::round(fg_weight * fg.r + bg_weight * bg.r);
+       green = std::round(fg_weight * fg.g + bg_weight * bg.g);
+       blue  = std::round(fg_weight*fg.b  + bg_weight * bg.b);
+       alpha = std::round(1 - (1 - fg.a) * (1 - bg.a));
 
        return ARGBColor(red, green, blue, alpha);
 }
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to