| 4443 | } |
| 4444 | |
| 4445 | static WORD GetNewColor(GTestColor color, WORD old_color_attrs) { |
| 4446 | // Let's reuse the BG |
| 4447 | static const WORD background_mask = BACKGROUND_BLUE | BACKGROUND_GREEN | |
| 4448 | BACKGROUND_RED | BACKGROUND_INTENSITY; |
| 4449 | static const WORD foreground_mask = FOREGROUND_BLUE | FOREGROUND_GREEN | |
| 4450 | FOREGROUND_RED | FOREGROUND_INTENSITY; |
| 4451 | const WORD existing_bg = old_color_attrs & background_mask; |
| 4452 | |
| 4453 | WORD new_color = |
| 4454 | GetColorAttribute(color) | existing_bg | FOREGROUND_INTENSITY; |
| 4455 | static const int bg_bitOffset = GetBitOffset(background_mask); |
| 4456 | static const int fg_bitOffset = GetBitOffset(foreground_mask); |
| 4457 | |
| 4458 | if (((new_color & background_mask) >> bg_bitOffset) == |
| 4459 | ((new_color & foreground_mask) >> fg_bitOffset)) { |
| 4460 | new_color ^= FOREGROUND_INTENSITY; // invert intensity |
| 4461 | } |
| 4462 | return new_color; |
| 4463 | } |
| 4464 | |
| 4465 | #else |
| 4466 |
no test coverage detected