Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation cover page looks bad in dark mode #254

Open
joansola opened this issue Jul 24, 2022 · 9 comments
Open

Documentation cover page looks bad in dark mode #254

joansola opened this issue Jul 24, 2022 · 9 comments

Comments

@joansola
Copy link
Collaborator

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

@joansola
Copy link
Collaborator Author

Like so:
image

@artivis
Copy link
Owner

artivis commented Jul 24, 2022

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.

@joansola
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@artivis
Copy link
Owner

artivis commented Jul 24, 2022

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}?

@joansola
Copy link
Collaborator Author

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

@joansola
Copy link
Collaborator Author

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...

@artivis
Copy link
Owner

artivis commented Jul 24, 2022

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 👍

@joansola
Copy link
Collaborator Author

OK then gray is the way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants