Skip to content

Commit

Permalink
Add Support for Custom System Color Overrides (#2376) (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Oct 21, 2024
1 parent 8fed68f commit cb67458
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Src/Common/SysColorHook.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file SysColorHook.h
* @file SysColorHook.cpp
*
* @brief Provides functionality to hook the GetSysColor() API and return custom colors.
*/
Expand Down Expand Up @@ -138,7 +138,10 @@ void Deserialize(const String& colorsStr, COLORREF* colors)
unsigned color = static_cast<unsigned>(tc::tcstoll(colorStr.c_str(), &endptr,
(colorStr.length() >= 2 && colorStr[1] == 'x') ? 16 : 10));
if (colors)
colors[index] = color;
{
if (index >= 0 && index < static_cast<int>(std::size(g_syscolor)))
colors[index] = color;
}
else
SysColorHook::SetSysColor(index, color);
}
Expand Down

0 comments on commit cb67458

Please sign in to comment.