A palette kept in two themes has two ways to go wrong. One is a pair whose contrast is too low. The other is quieter: a variable declared in one theme and forgotten in the other, so that in that theme the colour falls back to whatever the default is. Both are visible once the two blocks stand side by side.
Any CSS block works — the declarations are read out of it. Hex, rgb() and hsl() are understood; a colour with alpha is measured on its own value and marked, because the result depends on what lies beneath it.
Everything is computed in the browser. No value leaves this page.