Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extensions to use theme colors #26974

Closed
Tyriar opened this issue May 20, 2017 · 3 comments
Closed

Allow extensions to use theme colors #26974

Tyriar opened this issue May 20, 2017 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality themes Color theme issues
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented May 20, 2017

Some extensions contribute ui for example in html preview and decorations. It would be good if those colors could be sourced from the theme. Imagine you have a test coverage extension that out green/red indicators next to the line. These colors could be based on the diff editor addition/deletion colors.

@Tyriar Tyriar added the themes Color theme issues label May 20, 2017
@bpasero bpasero added the feature-request Request for new features or functionality label May 20, 2017
@bpasero bpasero removed their assignment May 20, 2017
@aeschli aeschli added this to the Backlog milestone May 22, 2017
@aeschli aeschli modified the milestones: May 2017, Backlog May 23, 2017
@aeschli aeschli changed the title Allow extensions to access theme colors Allow extensions to use theme colors May 24, 2017
@aeschli
Copy link
Contributor

aeschli commented May 24, 2017

I added new API to vscode.d.ts: colors in decoration options. Check out the new type ThemeColor. It stands for a reference to a color in the color registry and can be used in decorations.
https://code.visualstudio.com/docs/getstarted/theme-color-reference has the list of known colors.
Using a theme color is preferred over a custom color as it gives theme authors and users the possibility to change the color.

@paldepind
Copy link
Contributor

Is there a way to get the actual color associated with a ThemeColor?

Plugins like jumpy and MetaGo whould benefit greatly from this.

They render custom UI but they are not able to integrate it with the current color theme. The custom UI is created through an svg image but there is no way to use a ThemeColor inside an SVG. If they could get the raw color value they could use it in their UI.

@aeschli
Copy link
Contributor

aeschli commented Aug 28, 2017

There's currently no such API and I like to avoid adding it as it means bringing theme change notifications to the extension host as well.
Jumpy and MetaGo use the decorations API which accepts theme color for decoration backgrounds, foreground, and border. They would need to move away from generating SVGs to use the contentText.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality themes Color theme issues
Projects
None yet
Development

No branches or pull requests

4 participants