private static ConsoleColor ColorAttributeToConsoleColor(Interop.Kernel32.Color c)
{
// Turn background colors into foreground colors.
if ((c & Interop.Kernel32.Color.BackgroundMask) != 0)
{
c = (Interop.Kernel32.Color)(((int)c) >> 4);
}
return (ConsoleColor)c;
}