V
V
voproser456542022-03-04 20:55:05
cmd/bat
voproser45654, 2022-03-04 20:55:05

How to color console text with different colors?

How to color console text with different colors on Windows? Any AP will do.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2022-03-04
@vabka

Well, for example, in C# there is a standard property for setting color - Console.Color

R
res2001, 2022-03-05
@res2001

Are you talking about Windows?
There is a color command in cmd. I have never used it, so I don’t remember the color of what it changes, look in the help. Her set of colors is rather poor.
The console also supports Esc sequences, where you can set the colors of the displayed characters. But here, most likely, you will have to use the low-level Console API: https://docs.microsoft.com/en-us/windows/console/c...
Perhaps some console libraries support this. Something like ncurses.
You can also look at the source code, for example Far manager, to see how they work with color in the console.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question