Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
krlvm committed Jun 6, 2022
1 parent 930d619 commit f23dc70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
18 changes: 1 addition & 17 deletions AccentColorizer/AccentColorHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <VersionHelpers.h>
#include "ColorHelper.h"

#define RGB2BGR(a_ulColor) (a_ulColor & 0xFF000000) | ((a_ulColor & 0xFF0000) >> 16) | (a_ulColor & 0x00FF00) | ((a_ulColor & 0x0000FF) << 16)
#define RGB2BGR(color) (color & 0xFF000000) | ((color & 0xFF0000) >> 16) | (color & 0x00FF00) | ((color & 0x0000FF) << 16)

struct DWMCOLORIZATIONPARAMS {
DWORD dwColor;
Expand Down Expand Up @@ -36,22 +36,6 @@ bool accentOpaqueAvailable;
COLORREF _accentRgb;
BOOL _accentOpaque;

DWORD SetOpacity(DWORD color, float opacity) {
int alpha = (color >> 24) & 0xff;
int r = (color >> 16) & 0xff;
int g = (color >> 8) & 0xff;
int b = color & 0xff;

int newAlpha = ceil(alpha * opacity);

UINT newColor = r << 16;
newColor += g << 8;
newColor += b;
newColor += (newAlpha << 24);

return (DWORD)newColor;
}

void UpdateAccentColors()
{
DwmGetColorizationColor(&_accentRgb, &_accentOpaque);
Expand Down
3 changes: 1 addition & 2 deletions AccentColorizer/SysColorsModifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ void ModifySysColors(COLORREF accentColor) {
};
DWORD aNewColors[size];

COLORREF color = RGB(GetRValue(accentColor), GetGValue(accentColor), GetBValue(accentColor));
for (int i = 0; i < size; i++)
{
aNewColors[i] = color;
aNewColors[i] = accentColor;
}

SetSysColors(size, aElements, aNewColors);
Expand Down

0 comments on commit f23dc70

Please sign in to comment.