The CSApprox plugin was written before the +termguicolors feature was
even invented. It applies regardless of its presence, in any Vim
version which can remember GUI highlight settings while running in the
console. I tried to find out which Vim version this means but failed.
If when running Vim in a console and setting both (gui= guibg= guifg=
guisp= ) and (cterm= ctermfg= ctermbg= ) parts of the :highlight
command they are both remembered, then you should be all right.
> But I am actually interested in the internals. Is there a way to find
> the color index without manually checking color16 to color 255? Or
> even a comprehensive list of all uses of colorX with X > 15? No vim
> color scheme is used.
From the CSApprox plugin help:
[...]
Also, there are at least three different 256-color palettes in use. Nearly
all terminals use an xterm-compatible palette, so most users need not concern
themselves with this, with only two exceptions: Eterm uses a slightly
different palette, and older Konsole (pre KDE 2.2.0) used a third palette.
CSApprox has no reliable way to tell which palette your terminal uses, so it
makes some educated guesses:
[...]
There is also a "colortest" plugin, see ":help colortest.vim" — but by
default it will display the basic bg & fg colors by setting special
highlight groups to them. Vim cannot define anywhere near 16777216²,
or even 256², highlight groups at the same time so it is not possible
to get a list of all possible combinations displayed. IIUC the 256
colors are subdivided in 3 categories:
- Colors 0 to 0x0F are the colors used by 16-color terminals
- 216 (i.e. 6³) positions are used for the so-called "safe" colors,
i.e. those of the 16777216 for which the red, green and blue settings
are each (separately) a multiple of 0x33, namely one of {0x00, 0x33,
0x66, 0x99, 0xCC, 0xFF} for red, one of the same list for green and
one of the same list for blue.
- The rest (24 positions) are additional greyscale values.
Best regards,
Tony.