I can only answer for linux based terminals.
#include <iostream>
using std::cout;
using std::endl;
int main(){
char pinkish[] = { 0x1b, '[', '3', '8',';','5',';','2','1','2','m',0 };
char normal[] = { 0x1b, '[', '0', ';', '3', '9', 'm', 0 };
cout << pinkish << "Hello" << normal << endl;
}
Using the ANSI Color Codes, scroll down to the 256 bit color table.
{ 0x1b, '[', '3', '8',';','5',';','2','1','2','m',0 };
FOREGROUND COLOR: ESC[38;5;
BACKGROUND COLOR: ESC[48;5;
256 bit color value: 212
terminal character (I'm guessing): m
Hope this helps, it was interesting to research it. There is lot's of good info out there - way lots, but hopefully I summarized down to just what you asked for.
A couple of references:
Using-ANSI-Color-Codes-to-Colorize-Your-Bash-Prompt-on-Linux
ansi-color-specific-rgb-sequence-bash
color for text