On Mon, Sep 04, 2023 at 04:35:44PM +0200, Jürgen Spitzmüller wrote:
> * You have a non-default background branch color in the LyX 2.3
> document.
> 
> * This is taken as is and will be set as light mode color
> 
> * Now if no darkmode color is defined for the branch (which is the case
> here), LyX will generate one in Branch::setColors() via
> inverseRGBColor()
> 
> This usually results in a usable color for dark mode. My guess is: as
> you have defined the branch color in LyX 2.3 for _dark_ mode, it will
> result in something that is rather suitable for light mode.

That's all correct, I pay the price of having dark theme even in 2.3. 

> For your personal use, you can adapt the convert_branch_colors lyx2lyx
> method to shift the branch color to dark, i.e.
> 
> \color "somecolor" => \color "" "somecolor"

Thanks, I attach the patch if we need to reference this to someone else
in the future.

Pavel
diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index 4cc5fe5bdf..a1b61c9454 100644
--- a/lib/lyx2lyx/lyx_2_4.py
+++ b/lib/lyx2lyx/lyx_2_4.py
@@ -4038,6 +4038,9 @@ def convert_branch_colors(document):
            break
         # We only support the standard LyX background for now
         k = find_token(document.header, "\\color #faf0e6", i, j)
+        if k != -1:
+           document.header[k] = "\\color background"
+        k = find_token(document.header, "\\color #000000", i, j)
         if k != -1:
            document.header[k] = "\\color background"
         i += 1
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to