0

I've been trying to change the color of selected text using ANSI escape sequences turned into strings. It works on online compilers but not visual studios which just spits out the actual escape sequence and not its effect.

  string normal="\u001b[0m";
  string bold="\u001b[1m";
  string italic="\u001b[3m";
  string blink="\u001b[5m";
  string black="\u001b[30m";
  string red="\u001b[31m";
  string green="\u001b[32m";
  string yellow="\u001b[33m";
  string blue="\u001b[34m";
  string magenta="\u001b[35m";
  string cyan="\u001b[36m";

This is what I have. This is how it is formatted.

cout<<"Whatever" << bold <<"Special stuff";

0 Answers0