xxxxxxxxxx
using System;
class Demo {
public static void Main (string[] args) {
Console.BackgroundColor = ConsoleColor.Blue;
Console.WriteLine("Background color changed = "+Console.BackgroundColor);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\nForeground color changed = "+Console.ForegroundColor);
}
}
xxxxxxxxxx
// Change colour of the text
// This code changes the next text line colour
Console.ForegroundColor = ConsoleColor.Green;
// Pay attention that the texts that you want to change colour on
// Should be in between the 2 codes!
// This code puts the text colour back to normal again
Console.ResetColor();