Open joansola opened 2 years ago
Like so:
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.
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?
otherwise, a color [127,127,127] should do for all cases....
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}
?
yep, color gray should be the fix. I think it'll be visible. May we try?
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...
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:
OK then gray is the way
In particular, the LaTeX symbols in the features table, which are black, are not visible if the browser is in dark mode.