manif icon indicating copy to clipboard operation
manif copied to clipboard

Documentation cover page looks bad in dark mode

Open joansola opened this issue 1 year ago • 9 comments

In particular, the LaTeX symbols in the features table, which are black, are not visible if the browser is in dark mode.

joansola avatar Jul 24 '22 00:07 joansola

Like so: image

joansola avatar Jul 24 '22 00:07 joansola

Hi @joansola, I'm aware of this issue, but afaik there isn't a way to detect whether the browser is in light or dark mode in this context. The only solution would be to pick a font color that work for both mode. I've already addressed this issue in the past for the website using this script.

artivis avatar Jul 24 '22 16:07 artivis

Is the script changing the color of the latex object?

Is the documentation compiling the latex from source every time you refresh the screen, or that you renew the browser cache?

If so, one could try to detect color mode (e.g. "background" property "color") and pick a color that contrasts really.

e.g. latex_color = [255,255,255] - bkgnd_color

or latex_color = bkgnd_color + [127,127,127] mod 255

or just pick between white and black depending on bkgnd_color brightness sum(R,G,B)/3

if sum(bkgnd_color)/3 > 127
    latex_color = 0,0,0
else
   latex_color = 255,255,255

Does this make any sense to you?

joansola avatar Jul 24 '22 16:07 joansola

otherwise, a color [127,127,127] should do for all cases....

joansola avatar Jul 24 '22 16:07 joansola

The script simply sets the latex font color to white. There is no way to figure out the website background color afaik. As for the latex code, it is rendered by a third-party website (https://latex.codecogs.com/) in svg and embedded in markdown as an image. Altho Github recently introduced native Latex support so this could be revisited. This being said, either ways are somewhat limited and we can only stick to the predefined colors. So maybe changing for /color{gray}?

artivis avatar Jul 24 '22 16:07 artivis

yep, color gray should be the fix. I think it'll be visible. May we try?

joansola avatar Jul 24 '22 16:07 joansola

Otherwise, print the table with all the functions with a known background color, then do the latex in black or white according to the chosen background of the table...

joansola avatar Jul 24 '22 16:07 joansola

Otherwise, print the table with all the functions with a known background color, then do the latex in black or white according to the chosen background of the table...

It is a markdown table, can't really set the background. Anyway I'll see how to fix that :+1:

artivis avatar Jul 24 '22 16:07 artivis

OK then gray is the way

joansola avatar Jul 24 '22 16:07 joansola