Dark theme diagrams/pictures

6 views
Skip to first unread message

Ben Brawn

unread,
Sep 9, 2025, 10:15:25 PM (11 days ago) Sep 9
to Numbas Users
With the inclusion of a dark theme, it seems I will need to change all my graphs to have a white background so that people will be able to make out the details of each graph when they use dark mode (jsxgraph, jessecode, Eukleides), and I will need to make any images with a transparent background have a white background. Many diagrams in questions now simply disappear into the black background.

Or could we tell the svg images and jsxgraph to use the colours of the theme?

Or could the extensions themselves be updated to use the theme's colours as the default so everything works better in dark mode without me tinkering with each diagram?

Christian Lawson-Perfect

unread,
Sep 10, 2025, 4:22:39 AM (11 days ago) Sep 10
to numbas...@googlegroups.com
This is a good point that had slipped my mind.
I think pragmatically, we should put a white background behind static images, but it might be possible to get JSXGraph and Eukleides diagrams to use different colours in dark mode. I'll investigate.

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/numbas-users/d8f982fa-84c8-4faa-be42-cb652dcf66cbn%40googlegroups.com.

Christian Lawson-Perfect

unread,
Sep 10, 2025, 11:09:48 AM (10 days ago) Sep 10
to numbas...@googlegroups.com
I spent some time looking at getting Eukleides and JSXGraph diagrams to change their colours automatically, but in practice whatever I did would have been equivalent to just inverting the colours on the whole element as if it was a static image.

So I've put a white background behind all images, and added a display option to invert images when the background is dark. That option is off by default, so students will see a white background behind images even in dark mode, unless they explicitly turn the option on. 
Inverting colours makes photos look very weird, so I think it's safest to not do it by default.

Ben Brawn

unread,
Sep 10, 2025, 11:10:52 AM (10 days ago) Sep 10
to numbas...@googlegroups.com

Ben Brawn

unread,
Sep 11, 2025, 12:39:47 AM (10 days ago) Sep 11
to Numbas Users
eek 

so mathjax is counted as an image... now in dark mode all mathjax has white text but also a white background! So we definitely don't want mathjax included in the 'needs white background' camp.

invisible.PNG


Christian Lawson-Perfect

unread,
Sep 11, 2025, 3:13:07 AM (10 days ago) Sep 11
to numbas...@googlegroups.com
Oh, whoops! I should have tested that! I think I've now fixed it.

Reply all
Reply to author
Forward
0 new messages