向Vscode添加自定义颜色

问题描述 投票:1回答:3

你好,我最近从Atom切换到Vs代码,并尝试了一些教程,解释如何在他们的网站上添加语言支持我明白语言支持应该有颜色调整器在其中

问题是如何为自定义语言添加颜色?我习惯了自己的颜色,当我基本上每种语言都工作时,我会有一种寒意褪色的外观,所以它不会伤到我的眼睛

我尝试了之后创建了一个CSS语言支持我看到它没有颜色但是由于某种原因在VScode设置中[css]:{}被添加但是它是空的

有人可以指导我下一步该做什么或如何添加颜色我无法在VScode文档或互联网上找到任何信息

编辑:我创建了一个空语言支持,而不使用yo生成器导入textmate文件。

visual-studio-code vscode-extensions vscode-settings
3个回答
1
投票

如果要根据现有颜色主题自定义特定颜色或其他内容,请打开命令面板>开发人员:从当前设置生成颜色主题。

选择想要的实体并将其写入范围和设置,如下面的示例所示。 (我寻找自定义类颜色,因为在主题“Monokai Dimmed”,imo类颜色有可怕)

"editor.tokenColorCustomizations": {
    "textMateRules": [{
        "scope": "entity.name.class, entity.name.type", 
        "settings": {
            "foreground": "#A6E22E"
         }
    }]
}

这与之前的答案类似


0
投票

这样的东西可能有用:

https://code.visualstudio.com/docs/getstarted/themes#_customize-a-color-theme

它允许您通过用户设置自定义颜色,例如以下内容将更改JSON文件中属性名称的颜色:

{
  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "scope": "support.type.property-name.json",
        "settings": {
          "foreground": "#ff0000"
        }
      }
    ]
  }
}

0
投票

这是我发现完全自定义颜色的方式。在你的settings.json中,对于黑色背景和非常reeddish错误的texample:


"workbench.colorCustomizations": {

    // general settings - will apply to all color themes:
    "editorError.border": "#ff0000",
    "editor.background": "#000000",

    // you can customize for a single theme (fpr example, for dark themes)
    "[dark]": {
        "editor.background": "#000000",
        "terminal.background": "#000000",
        "editorError.foreground": "#ff1144",
        "errorForeground": "#ff1144",
    },
},

设置将自动完成属性,但万一您可以使用“从当前设置生成颜色主题”命令查看整个颜色列表。

© www.soinside.com 2019 - 2024. All rights reserved.