📜  system.drawing.color 到 system.consolecolor - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:17.882000             🧑  作者: Mango

代码示例1
int index = (c.R > 128 | c.G > 128 | c.B > 128) ? 8 : 0;
                index |= (c.R > 64) ? 4 : 0; 
                index |= (c.G > 64) ? 2 : 0; 
                index |= (c.B > 64) ? 1 : 0; 
                Console.ForegroundColor = (System.ConsoleColor)index;