Broken 2.3 -> 2.4 conversion for branch
Jürgen Spitzmüller
jspitzm at gmail.com
Mon Sep 4 14:35:44 UTC 2023
Am Montag, dem 04.09.2023 um 10:39 +0200 schrieb Pavel Sanda:
> I see, not conversion error, feature for dark theme.
> The problem is that dark theme typically comes with light font color,
> hence you don't see the text within the brancn. In my case it's
> white-ish text on white-ish background and I suspect this is rather
> typical.
>
> What about changing background defaults to something darkish.
> Make more sense to me as a default for the dark theme, no?
The default branch color (background) is the same as the respective
(default) workarea background. With dark theme, this is black. I think
this is a good choice.
On conversion of old documents (convert_branch_colors), we set the
branch color to the semantic "background" value if the static color of
the branch equals the default LyX workarea color (#faf0e6). This also
results in the correct colors both for dark and light mode.
I guess what happens in your case is:
* 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.
Don't know how to address this: We don't know whether users have used
dark mode in LyX 2.3. Actually it was not really supported. Our guess
that people will have used light mode will probably be sane in most
cases.
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"
This will maintain the defined color for dark and will even give
something useful for light.
But I don't see a general solution (and actually consider this a corner
case).
--
Jürgen
More information about the lyx-devel
mailing list