Internally, the program does indeed use the the CGA 16-color palette. Early 1980's technology.
However, when it talks to OpenGL, it uses 24-bit RGB or 32-bit RGB+alpha. It has to, as that's the only thing OpenGL supports.
This can even be seen in the init.txt file, which lets you override the default colors. I use html Dodger Blue for dark blue, and html Gold for brown.
Custom color palettes is late 1980's VGA-level technology. (Technically VGA was 18-bit color, but it was the first PC adapter that allowed custom colors.)
From object-code inspection, it would seem possible to give each and every item & mob a custom 24-bit foreground and 24-bit background color. The descriptor_color_standard.txt raw file may be preparation for such a change.
It appears that actually converting the code from 4-bit color to 24-bit color would be a lot of work. However it looks like the process would be mechanical enough that an intelligent-enough Perl script could do the gruntwork. (I doubt that Toady has much Perl-fu, though.)
If I were doing this refactoring, at the same time that this change was made I would modify the various draw routines to take a foreground and background color instead of setting the color values manually before each call. Encapsulation, you see. (I would also make variants that are given x/y coordinates instead of setting those manually.)
I would at this time like to recommend certain books to Toady: Refactoring by Fowler, Design Patterns by Gamma et al, Antipatterns by Brown et al, and Antipatterns and Patterns in Software Configuration Management, also by Brown et al. (Same Brown, different et al.) Good stuff.