SpikeHD / Dorion

Tiny alternative Discord client with a smaller footprint, snappier startup, themes, plugins and more!
https://spikehd.github.io/projects/dorion/
GNU General Public License v3.0
502 stars 21 forks source link

[Feature Request] Add accent color CSS property #230

Open maicol07 opened 2 months ago

maicol07 commented 2 months ago

Is your feature request related to a problem? Please describe. Accent color in a CSS property so themes can use it.

Describe the solution you'd like A CSS property that stores the accent color value and updates it when it changes.

Describe alternatives you've considered Manual accent color via CSS

Additional context BetterDiscord implementation: https://github.com/BetterDiscord/BetterDiscord/pull/1663 Tauri idea: https://github.com/tauri-apps/tauri/discussions/5305

maicol07 commented 1 month ago

@SpikeHD I've tried the accent colour CSS property, and it works fine. The only issue I've found is that changing the accent colour at runtime when Dorion is opened doesn't update the property until a reload. There's this that you can use to listen for changes; however, I don't know Rust, so I don't know how to use it: https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/UI/WindowsAndMessaging/constant.WM_DWMCOLORIZATIONCOLORCHANGED.html

SpikeHD commented 1 month ago

Yea its still WIP, features like that will be included but they just aren't right now, that's why I left this issue open 👍

maicol07 commented 1 month ago

Another thing to add is multiple variables for different formats (i.e. rgb, hsl, ...)

SpikeHD commented 1 month ago

I will only be including the one variable in hex format. From my knowledge, CSS functions that take colors will accept any format, and hex supports alpha values just like RGBA, so it shouldn't really matter which format is used nor would it be very useful to have other formats available.

yavko commented 6 days ago

I started work on a rust library for getting and listening for changes to the system accent colors (converts to RGB, not RGBA cuz alpha is useless and used nowhere), that works so far on linux (through xdg-desktop-portal), and windows. I'm finishing up windows, support and will also get macOS support working too. So maybe it could be used to add support for this.

SpikeHD commented 6 days ago

That sounds great! Looking forward to it 👍

yavko commented 5 days ago

That sounds great! Looking forward to it 👍

Got windows working finally (who knew figuring out how to listen for registry changes wouldn't be fun), but it's kinda scuffed. Also, I'm thinking of making the color format be a 0.0-1.0 scale, instead of 0-255, cuz the linux api uses that, and converting to 0-255 has a loss of detail, but idk if I should do it or not image edit: I need to clean up the stream api, but it looks like this rn image

yavko commented 2 days ago

Having trouble with macOS, rn I can only get the accent color, and not listen to it.