alefragnani / vscode-bookmarks

Bookmarks Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks
GNU General Public License v3.0
1.65k stars 161 forks source link

[FEATURE] - All Colors Settings to be Inside the Workbench Color Customizations. #644

Closed pouyakary closed 3 months ago

pouyakary commented 10 months ago

Hello, hope you're doing well. Thanks for the amazing extension. I could not have wanted this more.

I have a color theme that has two variants, one for dark and one for light mode. It is so exciting that your extension lets me customize the colors, but I wished all the color settings were included in the workbench.colorCustomizations. If that were the case I could have done 2 things that could have been so cool for me.

You already have 3 settings that are included in the workbench.colorCustomization. Can you please also move the following there?:

Again, this extension is such an amazing thing. I'm so happy that I found it today! Thanks a lot !

pouyakary commented 10 months ago

To give you an example of how cool that could be, the dart-code extension provides a feature that displays a comment indicating the end of a widget, denoted as a comment. In my theme I could have colored these specially for these, in both light and dark variants:

And I wish I could have colored the bookmark for my theme for both the dark and light variants like these:

alefragnani commented 3 months ago

Hi @pouyakary ,

This is not yet possible, because there is no API available to extract the color from Themes, and I need the color in order ot create the icon on the fly. There is an issue in the VS Code repo (https://github.com/microsoft/vscode/issues/32813) asking for that, but no ETA.

I'm subscibed to that issue, so any news I will be notified. In the meantime, I'm closing this issue,

Thanks for your undestanding.

pouyakary commented 3 months ago

I recently read the source of GitHub's Pull Request Extension on how they did it and it was really convenient: https://github.com/microsoft/vscode-pull-request-github/blob/main/package.json#L2721-L2731

You define a set of colors inside your package.json, and also give them a default value. Then a theme developer gets to define colors for that color you have defined and thus they can also support your extension on top of the normal colors the vscode has. The user as well can change the colors and even set them for different themes they have (like me for example for dark and light themes)

alefragnani commented 3 months ago

Yep, that's exacly how contributed colors works, and the Bookmarks extension uses it (https://github.com/alefragnani/vscode-bookmarks/blob/04ab0ca3ffb0dc1302f80cd0764187ffee5c0656/package.json#L641) for some colors. The icon colors, on the other hand, can't use this approach, because the extension needs the hex value in runtime, and VS Code does not provide that, only a reference to a ThemeColor which is not useful to create the .svg file on the fly.