Add ANSI escape codes to a given string to print colored text in consoles and terminal emulators.