Console.Color 1.0.1

dotnet add package Console.Color --version 1.0.1
                    
NuGet\Install-Package Console.Color -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Console.Color" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Console.Color" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Console.Color" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Console.Color --version 1.0.1
                    
#r "nuget: Console.Color, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Console.Color@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Console.Color&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Console.Color&version=1.0.1
                    
Install as a Cake Tool

ColorConsole A tiny, zero‑dependency C# library that lets you write colored and styled text to the console using inline ANSI tags.

Quick tip – If you want to combine tags with C# string interpolation, just escape the tag braces:

Csharp

Apply ColorConsole.WriteLine( Installation Bash Run dotnet add package ColorConsole Windows note – Windows 10+ terminals (e.g. Windows Terminal, ConEmu) already understand ANSI. For older Windows console apps, call Console.TreatControlCAsInput = true; or enable Virtual Terminal processing with the kernel32.dll call.

Quick Start Csharp

Apply using ColorConsole;

ColorConsole.WriteLine("The {blue}sky{/} is {yellow}bright{/}."); ColorConsole.WriteLine("{bold}Bold text{/} and {underline}underlined{/}."); ColorConsole.WriteLine("{bg-green white}Green background{/}."); ColorConsole.WriteLine("{rgb(255,120,0)}Custom orange{/}.");

Apply The sky is bright. Bold text and underlined. Green background. Custom orange. 📚 Supported Tags Tag Meaning Example {red} {green} {yellow} {blue} {magenta} {cyan} {white} Foreground color {red}Error{/} {bg-red} {bg-green} {bg-yellow} {bg-blue} {bg-magenta} {bg-cyan} {bg-white} Background color {bg-blue white}Text{/} {bold} {underline} {strike} Text style {bold}Important{/} {rgb(R,G,B)} 24‑bit foreground color {rgb(255,120,0)}Orange{/} {bg-rgb(R,G,B)} 24‑bit background color {bg-rgb(0,120,255)}Blue{/} {/} or {reset} Reset all styles {red}X{/} Multiple tags in one set Combine styles {yellow bold underline}Notice{/} All tags are case‑insensitive and can be combined in any order.

Interpolating Values Csharp

Apply int users = 12; ColorConsole.WriteLine($"There are {{green}}{users}{{/}} users online."); Escape the tag braces ({{ and }}) so the compiler doesn’t think they’re interpolation placeholders.

API Method Description ColorConsole.WriteLine(string input) Writes the formatted string and ends with \n. ColorConsole.Write(string input) Writes the formatted string without a newline. Both methods process the tags on the fly and automatically emit a reset sequence at the end of each line to keep styles from leaking.

FAQ Question Answer Does this work on Windows cmd? Only on Windows 10+ terminals that support ANSI (e.g. Windows Terminal, ConEmu, PowerShell). Can I use it in a library? Yes. The library is pure C# and has no external dependencies. What about .NET Core vs .NET Framework? It targets .NET Standard 2.0+, so it works on .NET Core, .NET 5+, and .NET Framework 4.6.1+. Contributing Pull requests are welcome!

Fork the repo. Create a feature branch. Run dotnet test. Submit a PR. License MIT – feel free to use it in any project, open source or commercial.

Happy colorful coding!

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 65 4/21/2026
1.0.0 66 4/20/2026