In the default theme every colour is TeX’s own, as in the PDF: black text is black, and links have the colours the document gave them. The other themes, light, dark, night blue, sepia and contrast, each replace some colours by a colour map, so that \textcolor{blue} stays readable on a dark background, and give links a colour of their own. The options above the example set its text size and theme, for the example only; the same options in the corner set them for the whole page. There, System follows the system: one theme while it is light and another while it is dark, by default the default theme and dark.
A blue remark, a red warning, and colour inside mathematics:
And tints, blue!20!white and red!20!white, shading a picture of a wave tunnelling through a barrier.
A \textcolor{blue}{blue remark}, a \textcolor{red}{red warning}, and
colour inside mathematics:
\[\textcolor{blue}{a^2} +\textcolor{red}{b^2} = c^2 .
\]And \emph{tints}, \verb|blue!20!white| and \verb|red!20!white|, shading a
picture of a wave tunnelling through a barrier.
\begin{center}\begin{tikzpicture}[x=1cm, y=1cm]
% where the wave may travel, and the barrier it tunnels through
\fill[blue!20!white] (0,0) rectangle (3,1.7);
\fill[red!20!white] (3,0) rectangle (4.2,1.7);
\fill[blue!20!white] (4.2,0) rectangle (7,1.7);
% the potential, and the wave's energy
\draw[red, thick] (0,0.25) -- (3,0.25) -- (3,1.35) -- (4.2,1.35) -- (4.2,0.25) -- (7,0.25);
\draw[black!50, dashed] (0,0.8) -- (7,0.8) node[right] {$E$};
% the wave function: oscillating, decaying inside the barrier, and out again smaller
\draw[blue, thick, smooth, samples=90, domain=0:3] plot (\x, {0.8+0.4*sin(deg(4*\x+2.137))});
\draw[blue, thick, smooth, samples=30, domain=3:4.2] plot (\x, {0.8+0.4*exp(-1.6*(\x-3))});
\draw[blue, thick, smooth, samples=90, domain=4.2:7] plot (\x, {0.8+0.059*sin(deg(4*(\x-4.2))+90)});
\node[blue] at (1.1,1.45) {$\psi$};
\node[red] at (3.6,1.52) {$V_0$};
\end{tikzpicture}\end{center}
A colour map is a small piece of JSON. For each theme it lists the colours to replace and how links look. It also lists tints: colours mixed with white, like blue!20!white, which are mixed again with the current background. The viewer has one built in, reflowtex, which this site uses. Here is what it does to the blue and red of the example:
As TeX wrote it
Default
Light
Dark
Night blue
Sepia
High contrast
Aablue #0000ff
Aakept
Aakept
Aa#79c0ff
Aa#8cc8ff
Aa#155e97
Aa#0000b3
Aared #ff0000
Aakept
Aakept
Aa#ff7b72
Aa#ff8f85
Aa#c02d0c
Aa#b30000
blue!20 = #ccccff
20% #0000ff
20% #0000ff
20% #79c0ff
20% #8cc8ff
20% #155e97
20% #0000b3
red!20 = #ffcccc
20% #ff0000
20% #ff0000
20% #ff7b72
20% #ff8f85
20% #c02d0c
20% #b30000
A site can give its own, in latex-color-maps/; a theme it gives replaces the built-in one. In the file:
A theme is a class on the page’s <html> element (light, dark, navy, sepia or contrast; none for the default theme), so switching themes only changes styles; nothing is drawn again. The Theming section of src/viewer/README.md has the details.