| 98 | } |
| 99 | |
| 100 | static WORD GetColorCode(uint32 color) |
| 101 | { |
| 102 | WORD code = 0; |
| 103 | #ifdef _WIN32 |
| 104 | if (((color >> 0) & 0xFF) > 0x40) |
| 105 | code |= FOREGROUND_BLUE; |
| 106 | if (((color >> 8) & 0xFF) > 0x40) |
| 107 | code |= FOREGROUND_GREEN; |
| 108 | if (((color >> 16) & 0xFF) > 0x40) |
| 109 | code |= FOREGROUND_RED; |
| 110 | if ((((color >> 0) & 0xFF) > 0xC0) || |
| 111 | (((color >> 8) & 0xFF) > 0xC0) || |
| 112 | (((color >> 16) & 0xFF) > 0xC0)) |
| 113 | code |= FOREGROUND_INTENSITY; |
| 114 | #endif |
| 115 | return code; |
| 116 | } |
| 117 | |
| 118 | static bool SetConsoleColor(uint32 fgColor, uint32 bgColor) |
| 119 | { |