Skip to content
Paint your console from .NET
Branch: master
Clone or download

build nuget


An easy peasy tiny library for coloring console output in inline strings using ANSI escape codes.


Console.WriteLine(Output.Green($"green {Output.Red($"{Output.Bold("bold")} red")} green"));
Console.WriteLine($"The difference {"between bold".Bold()}, {"bright green".BrightGreen()} and {"dim".Dim()}".Green());
Console.WriteLine(Output.BrightBlue($"Bright {Output.Green("and normal green")}"));
Console.WriteLine(Output.Green($"The difference {Output.Bold("between bold")} and {Output.BrightGreen("bright green")}"));
Console.WriteLine(Output.Bold().Green().Text($"starting green {Output.Red("then red")} must be green again"));


Two modes

The static methods accepting string input Output.Red("input") return formatted string output. This also works with nested interpolated strings Output.Red($"input {Output.Bold("bold")}"). Or as extension methods (on string) "input".Red().Bold().

Or building up a formatter using Output.Bold().Red().Text("input") where the string is only returned after closing with the Text method. This can also be mixed with interpolated strings.

Rainbows 🌈

Thanks to DevinR528 we now have rainbows!

var rainbow = new Rainbow(0.5);
for(var i = 0; i < 15; i++)

How compatible is it?

It works fine on everything except for older Windows versions.


My journey for using ANSI codes in C# first brought me here:

The ANSI coloring details was inspired by this blog post:

The code for enabling ANSI colors feature on Windows was borrowed from this issue:

No greater compliment than someone taking your work for inspiration. In return I peaked into his code for the RGB support!

You can’t perform that action at this time.