dotnet-installer/src/Microsoft.DotNet.Cli.Utils/AnsiColorExtensions.cs
Andrew Stanton-Nurse 6d3f07234a code review feedback
2015-10-15 12:56:07 -07:00

49 lines
1.2 KiB
C#

namespace Microsoft.DotNet.Cli.Utils
{
public static class AnsiColorExtensions
{
public static string Black(this string text)
{
return "\x1B[30m" + text + "\x1B[39m";
}
public static string Red(this string text)
{
return "\x1B[31m" + text + "\x1B[39m";
}
public static string Green(this string text)
{
return "\x1B[32m" + text + "\x1B[39m";
}
public static string Yellow(this string text)
{
return "\x1B[33m" + text + "\x1B[39m";
}
public static string Blue(this string text)
{
return "\x1B[34m" + text + "\x1B[39m";
}
public static string Magenta(this string text)
{
return "\x1B[35m" + text + "\x1B[39m";
}
public static string Cyan(this string text)
{
return "\x1B[36m" + text + "\x1B[39m";
}
public static string White(this string text)
{
return "\x1B[37m" + text + "\x1B[39m";
}
public static string Bold(this string text)
{
return "\x1B[1m" + text + "\x1B[22m";
}
}
}