是否可以从 VS 扩展中获取 Visual Studio IDE 中当前使用的颜色(不是主题名称)?我有一个扩展,我想在其中列出文本、面板背景等的确切颜色。
这里记录了许多可用选项。
是的,可以。
VSColorTheme:
var backgroundColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
EnvironmentColors定义中定义了各种颜色: