As far as I know the the finest granularity of any color element that can be modified in Vim is the "highlight group" (e.g. :hi Comment guifg=#FFF59D ....
). Color "primitives" are dictated by the system. So "blue" means one thing in Windows GUI window and another in an xterm window.
While the system defined colors are either non-alterable or have to be changed in a system dependent way there may be additional colors specified in an "rgb.txt" file. This is apparently not available on all systems but I can attest to it being available in Windows. If you have it it should be in $VIMRUNTIME/rgb.txt
. Here are a couple lines from my copy on Windows...
255 250 250 snow
248 248 255 ghost white
248 248 255 GhostWhite
245 245 245 white smoke
I haven't tried adding a new color but modifying these would be trivial.
If you have this file, great. If not try creating it with those pasted in lines and see if they seem to be recognized. Barring that you are probably relegated to using a system dependent method. Check Vim help for your system.
Update: Just tried adding my own color and it works fine.
Update2: For what it's worth I verified that this file exists and works in Cygwin and Ubuntu via WSL. Granted, it's still all, technically, Windows but @ChristianBrabandt just confirmed that the rgb.txt file is available and usable on all platforms.
I was able to edit existing color values as well as add new entries. You must be sure to save the changes to the original file and you'll need to quit vim and re-enter to see the changes. But other than that it's solid...as it should be for this apparently universal functionality.