[theming] Access theme's colors programmatically
See original GitHub issueI think we should add support for accessing theme’s colors programmatically.
For instance let’s take as an example the popular OneDark Pro theme, I’d like to access colors defined under tokenColors.
My use case: I’m making an extension that decorates some tokens, and I’d like them to have the same color that comments have in my theme, the problem is that the regex I use to find those tokens depends on some configurable value, so I cannot pre-compute it in advance and just put it in a .tmLanguage
file.
It’s already possible to somehow access colors defined under the colors key, via something like new vscode.ThemeColor ( 'activityBar.background' )
, adding support for this sounds like a useful generalization to me.
What do you think?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:195
- Comments:71 (37 by maintainers)
Top Results From Across the Web
android - Programmatically get theme colors - Stack Overflow
All of the work done to change the background colors is done in the btn_default Drawable . Source of btn_default.xml: 17 <selector xmlns:android="http://schemas ......
Read more >How to obtain theme colors programmatically
I want to be able to set programmatically various colors of my controls to theme colors. In particular I would like one pair...
Read more >Styles and Themes - Android Developers
A style can specify attributes such as font color, font size, background color, and much more. A theme is a collection of attributes...
Read more >How to programmatically set the color scheme for a theme?
No - this is not possible in 6.x due to how color is intended to work. Its meant to be a simple way...
Read more >Theme Color | Visual Studio Code Extension API
Theme colors are available as CSS variables in webviews, and an extension is available which provides IntelliSense for them. Color formats. Color values...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A lot of extensions would benefit from this. Bracket colorizer, jumpy, gitlens and a zillion others. Would be good to implement this.
This issue has come up again. In GitLens, I would like to expose 2 colors (hot and cold versions) for the heatmap that GitLens generates, but I am unable to use theme colors, because I need access to the real color values to generate the full palette of colors required.