| 461 | #endif // MSG_WRAP_TEXT |
| 462 | |
| 463 | COLORREF |
| 464 | setMsgTextColor(HDC hdc, int gray) |
| 465 | { |
| 466 | COLORREF fg, color1, color2; |
| 467 | if (gray) { |
| 468 | color1 = mswin_get_color(NHW_MESSAGE, MSWIN_COLOR_BG); |
| 469 | color2 = mswin_get_color(NHW_MESSAGE, MSWIN_COLOR_FG); |
| 470 | /* Make a "gray" color by taking the average of the individual R,G,B |
| 471 | components of two colors. Thanks to Jonathan del Strother */ |
| 472 | fg = RGB((GetRValue(color1) + GetRValue(color2)) / 2, |
| 473 | (GetGValue(color1) + GetGValue(color2)) / 2, |
| 474 | (GetBValue(color1) + GetBValue(color2)) / 2); |
| 475 | } else { |
| 476 | fg = mswin_get_color(NHW_MESSAGE, MSWIN_COLOR_FG); |
| 477 | } |
| 478 | |
| 479 | return SetTextColor(hdc, fg); |
| 480 | } |
| 481 | |
| 482 | void |
| 483 | onPaint(HWND hWnd) |
no test coverage detected