Comment by shiomiru
> The idea of taking a screenshot of the terminal and then parsing that to determine the true colour support is definitely novel,
A better way to do this is to send `OSC 1 0 ; ? ST` (query foreground color), `OSC 1 1 ; ? ST` (background color), then `OSC 4 ; {n} ; ? ST` where {n} is the nth XTerm color.
See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-O...
OMG really!? That link is blocked for me for some reason. If that OSC code is widely supported it's going to make things sooooo much easier.