微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

需要帮助将自定义颜色定义映射到 vscode 颜色定义

如何解决需要帮助将自定义颜色定义映射到 vscode 颜色定义

我想把这个自定义颜色定义映射到 vscode 夜猫子颜色定义中
但我不知道如何将这些映射到 vscode settings.json
希望大家多多帮助

我在 Visual Studio 代码中使用了 this Night Owl theme

自定义颜色定义:

 {
    id: "night-owl",name: "Night Owl",highlights: {
      background: "#011627",text: "#abb2bf",variable: "#82AAFF",attribute: "#F78C6C",deFinition: "#82AAFF",keyword: "#c792ea",operator: "#c792ea",property: "#fff",number: "#F78C6C",string: "#ecc48d",comment: "#717a8a",Meta: "#7fdbca",tag: "#7fdbca",},

有了这个,我可以把我的 vscode 夜猫子主题变成这样

enter image description here

解决方法

对于背景,如果您必须在 "editor.background" 下设置 "workbench.colorCustomizations"。例如,如果您将以下段添加到用户的 settings.json 文件中,它将更改背景、前景、活动前景和侧边栏背景。

"workbench.colorCustomizations": {
        "[Night Owl]": {
            "editor.background": "#ff0000","editor.foreground": "#000000","activityBar.foreground": "#00b7ff",//for activity foreground
            "sideBar.background": "#151616" //for sidebar background
        }
    },

要自定义代码,您必须使用 "editor.tokenColorCustomizations"。例如,下面的部分将自定义所有评论和功能。

"editor.tokenColorCustomizations": {
        "[Night Owl]": {
            "comments": "#717272","functions":  "#00b7ff",}
    }

希望你有这个想法。如需更多信息,请查看 vscode color theme 部分和 reference 页面。您也可以查看Night Owl's readme file

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。