question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[theming] Access theme's colors programmatically

See original GitHub issue

I 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:open
  • Created 6 years ago
  • Reactions:195
  • Comments:71 (37 by maintainers)

github_iconTop GitHub Comments

21reactions
vviikkcommented, Jun 26, 2018

A lot of extensions would benefit from this. Bracket colorizer, jumpy, gitlens and a zillion others. Would be good to implement this.

20reactions
eamodiocommented, Jun 20, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found