MCPcopy Create free account
hub / github.com/WinMerge/winmerge / GetBackgroundColor

Method GetBackgroundColor

Src/LocationView.cpp:165–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165COLORREF CLocationView::GetBackgroundColor()
166{
167 COLORREF clrBackground = GetDocument()->GetView(0, 0)->GetColor(COLORINDEX_WHITESPACE);
168 if (!IsColorDark(clrBackground))
169 {
170 return RGB(
171 (std::max)(GetRValue(clrBackground) - 24, 0),
172 (std::max)(GetGValue(clrBackground) - 24, 0),
173 (std::max)(GetBValue(clrBackground) - 12, 0));
174 }
175 return RGB(
176 (std::min)(GetRValue(clrBackground) + 20, 255),
177 (std::min)(GetGValue(clrBackground) + 20, 255),
178 (std::min)(GetBValue(clrBackground) + 32, 255));
179}
180
181/**
182 * @brief Draw custom (non-white) background.

Callers

nothing calls this directly

Calls 3

IsColorDarkFunction · 0.85
GetColorMethod · 0.45
GetViewMethod · 0.45

Tested by

no test coverage detected