Giter Club home page Giter Club logo

Comments (9)

joansola avatar joansola commented on July 4, 2024

Like so:
image

from manif.

artivis avatar artivis commented on July 4, 2024

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.

from manif.

joansola avatar joansola commented on July 4, 2024

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?

from manif.

joansola avatar joansola commented on July 4, 2024

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

from manif.

artivis avatar artivis commented on July 4, 2024

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

from manif.

joansola avatar joansola commented on July 4, 2024

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

from manif.

joansola avatar joansola commented on July 4, 2024

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

from manif.

artivis avatar artivis commented on July 4, 2024

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 👍

from manif.

joansola avatar joansola commented on July 4, 2024

OK then gray is the way

from manif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.