皮肤样式是一种特殊的扩展程序,可以改变浏览器的外观。 皮肤样式的打包与普通的扩展程序类似,只是不含 JavaScript 或 HTML 代码。
您可以在 猎豹皮肤中心 中寻找与尝试各种主题背景:
以下是用于主题背景的manifest.json的例子:
{
"version": "2.6",
"name": "camo theme",
"theme": {
"images" : {
"theme_frame" : "images/theme_frame_camo.png",
"theme_frame_overlay" : "images/theme_frame_stripe.png",
"theme_toolbar" : "images/theme_toolbar_camo.png",
"theme_ntp_background" : "images/theme_ntp_background_norepeat.png",
"theme_ntp_attribution" : "images/attribution.png"
},
"colors" : {
"frame" : [71, 105, 91],
"toolbar" : [207, 221, 192],
"ntp_text" : [20, 40, 0],
"ntp_link" : [36, 70, 0],
"ntp_section" : [207, 221, 192],
"button_background" : [255, 255, 255]
},
"tints" : {
"buttons" : [0.33, 0.5, 0.47]
},
"properties" : {
"ntp_background_alignment" : "bottom"
}
}
}
颜色以RGB形式表示,在 manifest.json 配置文件中的格式是 [R, G, B],例如:紫罗兰色(#EE82EE)书写格式为 [238, 130, 238]。 可以在 theme_service.cc 文件中 kColor* 字串部分找到可以在此使用的字符串。
相关文件:theme_service.cc.
我们也可以指定应用于用户界面某些部分的色调,例如按钮框架和后台标签页。 猎豹浏览器 支持色调而不是图片,因为图片不一定能跨平台使用,并且在增加新按钮时不适用。 有关您可以在”tints”中使用的字符串,在 theme_service.cc中 寻找 `kTint*`字符串。
色调以色调-饱和度-亮度(HSL)的格式指定,使用0-1.0之间的浮点数:
还可以对任意HSL值使用 -1.0 表示没有变化。
由社区撰写的相关帮助文档在这里(英文):