From f23dc70683f3eacc80fb20206f2f8d43318ef122 Mon Sep 17 00:00:00 2001 From: krlvm <51774833+krlvm@users.noreply.github.com> Date: Mon, 6 Jun 2022 21:53:06 +0300 Subject: [PATCH] Cleanup --- AccentColorizer/AccentColorHelper.cpp | 18 +----------------- AccentColorizer/SysColorsModifier.cpp | 3 +-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/AccentColorizer/AccentColorHelper.cpp b/AccentColorizer/AccentColorHelper.cpp index 01955cf..a7dfab7 100644 --- a/AccentColorizer/AccentColorHelper.cpp +++ b/AccentColorizer/AccentColorHelper.cpp @@ -3,7 +3,7 @@ #include #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; @@ -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); diff --git a/AccentColorizer/SysColorsModifier.cpp b/AccentColorizer/SysColorsModifier.cpp index 9a2a1a8..938cfda 100644 --- a/AccentColorizer/SysColorsModifier.cpp +++ b/AccentColorizer/SysColorsModifier.cpp @@ -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);