'Is it possible to access VS Codes theme properties programatically? Like, can a person use the VS Code API to change a theme color?
Programmatically Accessing VSCode Theme Properties
Is it possible to programmatically & dynamically get & set the colors of V.S. Code's theme property's using the V.S. Code API?
The snippet bellow demonstrates using The VSCode API, and its method, getConfiguration(), to change settings. I was hopping that something like this snippet would work from programmatically changing theme colors, but to no avail.
const workbenchConfig = vscode.workspace.getConfiguration('workspace');
const themeColor = workbenchConfig.get(`colorTheme.${themeProperty}`);
console.log(themeColor)
// The argument colorTheme.${someColor} would is obviously replaced with the
// theme's property that I want to access.
I wanted to access the same object that the workbench.ColorCustomizations setting accesses, using the snippet above. My thinking was that I could set the theme colors in the same scope, that is used by workbench.colorCustomizations setting, but my attempt was without success.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
