krlvm / AccentColorizer

Recolorize Win32 controls in-memory with accent color without patching theme
MIT License
369 stars 12 forks source link

AccentColorizer doesn't work in dark mode in Windows 11 #10

Closed Dhyfer1 closed 2 years ago

Dhyfer1 commented 2 years ago

Hi.

I am using the latest version of AccentColorizer. When I select a file or folder, its selection box doesn't colorize to the accent color as shown in the image, and only colorize the name of the file/folder.

image_6

Using the light mode it works without problem, but in the dark mode what I mentioned above happens. Any solution to make it work smoothly in dark mode or should it come in the next version of AccentColorizer?

krlvm commented 2 years ago

AccentColorizer recolors only colored things. File selection highlight in dark theme is just a white color with certain alpha value, while in light theme it is blue. Technically speaking, AccentColorizers converts accent color from RGB to HSV, gets hue value, converts theme bitmap pixels from RGB to HSV, changes the hue value and converts it back to RGB. This is useless with white and black, but it is also does not needed in dark theme, because a contrast needs to be guaranteed for usability.

Dhyfer1 commented 2 years ago

Oh, what a pity 😞. I see that it works fine when Windows uses the light theme, but in dark mode it doesn't change the color of the selection box as I showed in the image (since the dark theme appeared in Windows 10 I have left the light theme aside). I would have liked an orange color for the selection box in the dark theme, I just hope that in a next version AccentColorizer can fix this little problem.

OrthodoxWindows commented 1 year ago

@Dhyfer1 I'm planning to create a custom dark visual style, which would fix the stupid "dark mode" issues. There's no reason why a well-designed style can't support Accent Applicator

Dhyfer1 commented 1 year ago

@OrthodoxWindows AccentColorizer, as indicated in the description in the repository, says: Recolorize Win32 controls in-memory with accent color without patching theme. Your planned custom dark visual style can work without patching the theme, and fix the presented problem of this issue?

If you can get the accent color to also be applied to the selection box as seen in the screenshots in this repository, but using Windows in dark theme, I would be very interested in trying your solution. I really still want to see the accent color for the dark mode, only that AccentColorizer still doesn't work for what I want and what I already mentioned, which was the reason for creating this issue.

OrthodoxWindows commented 1 year ago

Don't get too excited, this is just a project.

But actually, I'm pretty sure of the good result, it's just that this kind of project takes a long time to complete (and I have other priorities at the moment).

A big problem with Dark Mode is that it's not a separate visual style, but a mode within the Aero visual style. While it is technically feasible for Microsoft to use a separate visual style (this is the case with Aerolite). This is a stupidity from Microsoft, which has been multiplying stupidities for a few years at the user interface level. However, I suspect willful stupidity, since dark mode doesn't support Win32 apps; it's possible that it was to force people to migrate to UWP apps, and to give the illusion that the Win32 interface would be outdated (which it absolutely isn't, even the first version of Windows could be switched to dark colors).

There are already third-party dark styles, like this one : https://www.deviantart.com/kdr3w/art/Dark-811932372

On the other hand, you have to patch uxtheme. And the same for my future style, you'll have to patch uxtheme, it's impossible to get around that. However, there is now an alternative tool: https://github.com/namazso/SecureUxTheme

krlvm commented 1 year ago

The reason AccentColorizer doesn't work with dark mode is that it's just a "mode" and not a standalone visual style, while it's technically feasible (incidentally, Windows recent versions contain two visual styles: Aero and Aerolite, which proves that it is possible).

The actual reason is that, as I've said previously, that it works by adjusting hue in HSV representation of theme bitmap pixels. The colors of these pixels in the dark mode are shades of gray, and therefore are not colorized.

This is a stupidity from Microsoft, which has been multiplying stupidities for a few years at the user interface level.

This is definitely not a stupidity, because there's a lot of applications that have been developed with assumption that the background is light, what was leading to hardcoding, for example, shades of gray or black as text color, while background itself used colors set by theme, or vice versa. There are tons of problems associated with this, for example, this approach will break Excel (https://github.com/namazso/SecureUxTheme/issues/16).

Another thing is that the Microsoft's dark theme support in Win32 is lousy, incomplete, buggy, inconsistent, and just plain ugly.

OrthodoxWindows commented 1 year ago

I actually confused the accent color with the dark mode bad design issue. Mea culpa (I edited my previous post to correct the error). I'm going to experiment with the visual style of kdr3w, which seems to have a blue accent color.

Regarding the hard-coded elements, I understand the point of view. Applications with hard-coded graphical elements are a bane that has existed since the beginning of GUIs. And when Microsoft does not even respect its own rules (see Excel) it is simply hopeless... Regarding Win32 support, this is precisely the goal of my project: to fix Win32 support. However, this will not be able to correct the hard-coded elements...

Dhyfer1 commented 1 year ago

Hmm. About the deviantart link is just another theme of the many that are available on that site, and to apply them you need some tools to patch the system, this I already knew. There are very nice themes, and although I know that with some of them I could have the accent color in the selection box with Windows in dark mode, for the moment I am not interested in using themes.