Is it possible to write to the console in colour in .NET?

NibblyPig picture NibblyPig · Apr 30, 2010 · Viewed 114.7k times · Source

Writing a small command line tool, it would be nice to output in different colours. Is this possible?

Answer

Mark Byers picture Mark Byers · Apr 30, 2010

Yes. See this article. Here's an example from there:

Console.BackgroundColor = ConsoleColor.Blue;
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("White on blue.");

enter image description here