зеркало из
1
0
Форкнуть 0

Vary color scheme depending on background

This commit is contained in:
Charlie Poole 2014-08-29 18:37:42 -07:00
Родитель f8ffd4eb67
Коммит b1522d2f2a
1 изменённых файлов: 83 добавлений и 23 удалений

Просмотреть файл

@ -149,31 +149,91 @@ namespace NUnit.ConsoleRunner.Utilities
/// <returns></returns>
public static ConsoleColor GetColor(ColorStyle style)
{
switch (style)
switch (Console.BackgroundColor)
{
case ColorStyle.Header:
return ConsoleColor.White;
case ColorStyle.SubHeader:
return ConsoleColor.Gray;
case ColorStyle.SectionHeader:
return ConsoleColor.Cyan;
case ColorStyle.Label:
return ConsoleColor.Green;
case ColorStyle.Value:
return ConsoleColor.White;
case ColorStyle.Pass:
return ConsoleColor.Green;
case ColorStyle.Failure:
return ConsoleColor.Red;
case ColorStyle.Warning:
return ConsoleColor.Yellow;
case ColorStyle.Error:
return ConsoleColor.Red;
case ColorStyle.Output:
return ConsoleColor.Gray;
case ColorStyle.Default:
case ConsoleColor.White:
switch (style)
{
case ColorStyle.Header:
return ConsoleColor.DarkBlue;
case ColorStyle.SubHeader:
return ConsoleColor.DarkGray;
case ColorStyle.SectionHeader:
return ConsoleColor.DarkBlue;
case ColorStyle.Label:
return ConsoleColor.DarkGreen;
case ColorStyle.Value:
return ConsoleColor.Blue;
case ColorStyle.Pass:
return ConsoleColor.Green;
case ColorStyle.Failure:
return ConsoleColor.Red;
case ColorStyle.Warning:
return ConsoleColor.Yellow;
case ColorStyle.Error:
return ConsoleColor.Red;
case ColorStyle.Output:
return ConsoleColor.DarkGray;
case ColorStyle.Default:
default:
return ConsoleColor.Green;
}
case ConsoleColor.Gray:
switch (style)
{
case ColorStyle.Header:
return ConsoleColor.White;
case ColorStyle.SubHeader:
return ConsoleColor.DarkGray;
case ColorStyle.SectionHeader:
return ConsoleColor.Cyan;
case ColorStyle.Label:
return ConsoleColor.Green;
case ColorStyle.Value:
return ConsoleColor.White;
case ColorStyle.Pass:
return ConsoleColor.Green;
case ColorStyle.Failure:
return ConsoleColor.Red;
case ColorStyle.Warning:
return ConsoleColor.Yellow;
case ColorStyle.Error:
return ConsoleColor.Red;
case ColorStyle.Output:
return ConsoleColor.DarkGray;
case ColorStyle.Default:
default:
return ConsoleColor.Green;
}
default:
return ConsoleColor.Green;
switch (style)
{
case ColorStyle.Header:
return ConsoleColor.White;
case ColorStyle.SubHeader:
return ConsoleColor.Gray;
case ColorStyle.SectionHeader:
return ConsoleColor.Cyan;
case ColorStyle.Label:
return ConsoleColor.Green;
case ColorStyle.Value:
return ConsoleColor.White;
case ColorStyle.Pass:
return ConsoleColor.Green;
case ColorStyle.Failure:
return ConsoleColor.Red;
case ColorStyle.Warning:
return ConsoleColor.Yellow;
case ColorStyle.Error:
return ConsoleColor.Red;
case ColorStyle.Output:
return ConsoleColor.Gray;
case ColorStyle.Default:
default:
return ConsoleColor.Green;
}
}
}