CSharp examples for System.Drawing:Color
Write with console color
using System;// w w w .j a va2 s . c o m public class Main{ public static void Write(ConsoleColor color, object obj) { Write(color, obj.ToString(), null); } public static void Write(ConsoleColor color, string format, params object[] objects) { ConsoleColor previousColor = Console.ForegroundColor; Console.ForegroundColor = color; if (objects == null) { Console.Write(format); } else { Console.Write(format, objects); } Console.ForegroundColor = previousColor; } }