[theming] Access theme's colors programmatically
I think we should add support for accessing theme's colors programmatically. For instance let's take as an example the popular [OneDark Pro](https://github.com/Binaryify/OneDark-Pro/blob/master/themes/OneDark-Pro.json) theme, I'd like to access colors defined under [tokenColors](https://github.com/Binaryify/OneDark-Pro/blob/master/themes/OneDark-Pro.json#L67). 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](https://github.com/Binaryify/OneDark-Pro/blob/master/themes/OneDark-Pro.json#L4) key, via something like `new vscode.ThemeColor ( 'activityBar.background' )`, adding support for this sounds like a useful generalization to me. What do you think?
Posted by fabiospampinato on Aug 19, 2017, 12:53 AM
Tags
Related issues
- Add 65536 size support for maps
- TypeScript 7.1 Iteration Plan
- nvim-treeconfig: upstream nvim-treesitter
- Add the "action" and "method" attributes to <button>
- [FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
- > We were imposed GitHub for so many exercises!
Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments
support (Software)
Add 65536 size support for maps
TypeScript 7.1 Iteration Plan
nvim-treeconfig: upstream nvim-treesitter
Add the "action" and "method" attributes to <button>
[FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
> We were imposed GitHub for so many exercises!
Add support for Visual Studio 2026 Integration
Support for Helm v4
[theming] Access theme's colors programmatically
I think we should add support for accessing theme's colors programmatically. For instance let's take as an example the popular [OneDark Pro](https://github.com/Binaryify/OneDark-Pro/blob/master/themes/OneDark-Pro.json) theme, I'd like to access colors defined under [tokenColors](https://github.com/Binaryify/OneDark-Pro/blob/master/themes/OneDark-Pro.json#L67). 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](https://github.com/Binaryify/OneDark-Pro/blob/master/themes/OneDark-Pro.json#L4) key, via something like `new vscode.ThemeColor ( 'activityBar.background' )`, adding support for this sounds like a useful generalization to me. What do you think?
Comments (0)
No comments yet. Start the discussion.