Tomas
Tomas

Reputation: 765

System.Drawing.Color in console application

Simple question from .NET beginner. How to work with colors in console application? VS do not let me declarate System.Drawing.Color namespace. I need to assign color for one method in console application.

Regards, Tomas

Upvotes: 8

Views: 5522

Answers (2)

Kristof Verbiest
Kristof Verbiest

Reputation: 572

This is actually very simple, for example:

Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Yellow");

Upvotes: 7

Jon Skeet
Jon Skeet

Reputation: 1503519

All you need to do is add a reference to System.Drawing.dll. This isn't included by default in a console app, but you can add it without any issues.

Upvotes: 16

Related Questions