2015-11-16 11:21:57 -08:00
|
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli.Utils
|
2015-10-13 14:31:29 -07:00
|
|
|
|
{
|
2015-10-15 12:56:07 -07:00
|
|
|
|
public static class AnsiColorExtensions
|
2015-10-13 14:31:29 -07:00
|
|
|
|
{
|
|
|
|
|
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";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|