I am writing a C++ class permitting the usage of color in terminal. I want it works on every terminal :
- printing with true color (24 bits) on terminals that supports it,
- with 256 color (6x6x6) on terminals that supports it,
- else with the basic 16 colors.
I wrote once C functions using termcap, and I thought using it in this case. However, the man page says :
The termcap database is an obsolete facility for describing the capabilities of character-cell terminals and printers. It is retained only for capability with old programs; new ones should use the terminfo database and associated libraries.
So I tried to use terminfo, but I could not find how to do this. There is not terminfo.h in my system (I run on Debian).
My questions is :
How can I get the color possibilities of the current terminal in C/C++, using the newest tools (ie not termcap, according to manpage) ?