alefragnani / vscode-separators

Separators Extension for Visual Studio Code
GNU General Public License v3.0
40 stars 6 forks source link

[FEATURE] - Add an option of separator opacity #96

Closed Stehsaer closed 6 months ago

Stehsaer commented 6 months ago

I personally prefer separators with less opacity than completely opaque. However, tweaking and setting the colors one by one is quite annoying. So I suggest adding an option to determine the opacity of separators.

alefragnani commented 6 months ago

Hi @Stehsaer ,

This has already been requested in #77, but unfortunately remains without an API to support the merge between a color and an external setting.

If something changes on that VS Code issue, I'll be notified, because I've subscribed to it.

Hope this helps

Stehsaer commented 6 months ago

Sorry for reporting a duplicated issue.

By the way, is it viable to manually parse and combine hex values as strings?

For example, #ff0000 and opacity of 50%, turn 50% into hex value of 0x80, and combine into #ff000080

Stehsaer commented 6 months ago

If we can grab the colors and generate the separators using hex color string, this is theoretically viable. If possible, please point out the related code and I'm glad to contribute.

alefragnani commented 6 months ago

There is no way to load values from a ThemeColor, so if a theme extension defines any color contributed by the extension, you won't be able to parse. That's the missing API I described above.

Parse values overridden by users in workbench.colorCustomizations is possible, for sure, as it is a user setting like any other, but it won't work if the users doesn't override the value. The reason I don't use this approach is because it only works for the users that has changed the value.

If you want to play with it, feel free. The file that handles the colors and creation of decoration is decoration.ts . Maybe you find and alternative to this, or the getConfiguration API has changed and will provide more info that before.

Hope this helps