Dennis van den Ouden-van der Horst created a new sphinx extension which allow you to use CSS named colours and custom colours in various items in your book:
- LaTeX
- Markdown text
- Admonitions!
In combination with the Sphinx Image Inverter this allows you to use the same colours in images, text and LaTeX, in both light and dark mode!
The custom names extension is released as a sphinx extension in this GitHub repository. It’s described in the manual too with some colours.