Color c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Color c++

How can i insert color in c++

31st Aug 2018, 6:39 PM
Gabriele Cusano
Gabriele Cusano - avatar
3 Answers
+ 2
Output? ANSI escape sequences have color-setting commands. You can use them directly: cout << "\x1b[32m;" << "green text"; or here's an import: https://gist.github.com/twoixter/1251356 so you can: cout << ansi::green << "text"; It also detects terminal type so it won't output escape sequences to incompatible streams.
31st Aug 2018, 7:46 PM
Kirk Schafer
Kirk Schafer - avatar
+ 1
you would use a graphics library like SDL. not available on SoloLearn however.
31st Aug 2018, 7:33 PM
hinanawi
hinanawi - avatar
0
tnx
2nd Sep 2018, 10:31 AM
Gabriele Cusano
Gabriele Cusano - avatar