how to change the colour of console text in C# code example
Example 1: c# change colour of console
Console.BackgroundColor = ConsoleColor.Green;
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.Clear();
Console.WriteLine("yo");
Console.ReadLine();
Example 2: c# console foreground color
Console.ForegroundColor = ConsoleColor.DarkGreen;
Example 3: c# color to console color
public static ConsoleColor FromColor(Color c)
{
int index = (c.R > 128 | c.G > 128 | c.B > 128) ? 8 : 0;
index |= (c.R > 64) ? 4 : 0;
index |= (c.G > 64) ? 2 : 0;
index |= (c.B > 64) ? 1 : 0;
return (System.ConsoleColor)index;
}