예제 #1
0
        public static Color ToColor(this ConsoleColor consoleColor)
        {
            var isBright = consoleColor.HasFlag((ConsoleColor)8);
            var hasRed   = consoleColor.HasFlag((ConsoleColor)4);
            var hasGreen = consoleColor.HasFlag((ConsoleColor)2);
            var hasBlue  = consoleColor.HasFlag((ConsoleColor)1);

            return(Color.FromArgb((hasRed ? 128 : 0) + (isBright ? 127 : 0), (hasGreen ? 128 : 0) + (isBright ? 127 : 0), (hasBlue ? 128 : 0) + (isBright ? 127 : 0)));
        }