A very simple class library to aid in printing coloured output to the console.
Build Status
.Net | Mono | |
---|---|---|
master | ||
develop |
The public API is small. Simply create an instance of ConsoleWriter
:
using System;
using ColorConsole;
...
var console = new ConsoleWriter();
and invoke the method of your choice:
console.Write("Be seeing you!", ConsoleColor.Yellow);
Ideally, you should rely on the IConsoleWriter
type.
This interface can then be used in conjunction with your favourite DI framework.
The main motivation was to reduce the typical boilerplate code involved to output colored text to the console. Quite often, you would see console applications defining/duplicating this behaviour in their own assembly each time it was required.
The easiest way to install ColorConsole
is via Paket or Nuget.
Paket
Assuming your project has paket.exe
under .paket/paket.exe
Mono:
mono .paket/paket.exe add nuget ColorConsole
.Net
.paket/paket.exe add nuget ColorConsole
Nuget
Install-Package ColorConsole
Acquire the source code.
bash build.sh
Or if you don't have access to a bash env:
build.cmd
Logo credit to deadletterdesign