Ask coding questions

← Back to all posts
How do I change the color of the console in c++?
cancrusher (7)

I already have the color of the text in the console down but what about the background color of the console. I'm using c++ btw.

DynamicSquid (5070)

Check this page to get a complete list of colours.

For example, the table show the background colour red being \033]41m, and the background colour of yellow being \033[43m.

You can use it like this:

There's also 256 bit colours, which ae described in that same page.

Hope this helps :)

Coder100 (19279)

It is the same...?

if you mean entire terminal background, it would be much harder than just highlighted text, as this code demonstrates:


You mean the console where the printed text is? I don't think you can change that. If you aren't talking about that 'console', then I'm not sure