зеркало из
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> /// <returns></returns>
public static ConsoleColor GetColor(ColorStyle style) public static ConsoleColor GetColor(ColorStyle style)
{ {
switch (style) switch (Console.BackgroundColor)
{ {
case ColorStyle.Header: case ConsoleColor.White:
return ConsoleColor.White; switch (style)
case ColorStyle.SubHeader: {
return ConsoleColor.Gray; case ColorStyle.Header:
case ColorStyle.SectionHeader: return ConsoleColor.DarkBlue;
return ConsoleColor.Cyan; case ColorStyle.SubHeader:
case ColorStyle.Label: return ConsoleColor.DarkGray;
return ConsoleColor.Green; case ColorStyle.SectionHeader:
case ColorStyle.Value: return ConsoleColor.DarkBlue;
return ConsoleColor.White; case ColorStyle.Label:
case ColorStyle.Pass: return ConsoleColor.DarkGreen;
return ConsoleColor.Green; case ColorStyle.Value:
case ColorStyle.Failure: return ConsoleColor.Blue;
return ConsoleColor.Red; case ColorStyle.Pass:
case ColorStyle.Warning: return ConsoleColor.Green;
return ConsoleColor.Yellow; case ColorStyle.Failure:
case ColorStyle.Error: return ConsoleColor.Red;
return ConsoleColor.Red; case ColorStyle.Warning:
case ColorStyle.Output: return ConsoleColor.Yellow;
return ConsoleColor.Gray; case ColorStyle.Error:
case ColorStyle.Default: 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: 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;
}
} }
} }