什么是主题?

主题是一种特殊的扩展,可以改变浏览器的外观。主题像常规扩展一样打包,但它们不包含 JavaScript 或 HTML 代码。

您可以在 Chrome 网上应用店找到并试用一系列主题。

图1

图2

图3

# Manifest

下面是一个主题的 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"
    }
  }
}

# colors

颜色采用 RGB 格式。要查找可以在“colors”字段中使用的字符串,请参阅 kOverwritableColorTable

# images(图像)

图像资源使用相对于扩展根的路径。您可以覆盖由 kPersistingImages 中的字符串指定的任何图像。所有图像必须以 PNG 格式存储,否则将无法正确呈现

# properties (属性)

此字段允许您指定诸如背景对齐、背景重复和备用徽标等属性。要查看属性及其可以具有的值,请参阅 kDisplayProperties

# tints (色调)

您可以指定要应用于 UI 部分(例如按钮、框架和背景选项卡)的色调。谷歌浏览器支持色调,而不是图像,因为图像不能跨平台工作,并且在添加新按钮的情况下很脆弱。要查找可以在“tints”字段中使用的字符串,请参阅 kTintTable

色调采用 Hue-Saturation-Lightness (HSL) 格式,使用 0 - 1.0 范围内的浮点数:

  • Hue 是一个绝对值,0 和 1 是红色。
  • Saturation(饱和度) 与当前提供的图像有关。 0.5 表示没有变化,0 表示完全去饱和,1 表示完全饱和。
  • Lightness(亮度) 也是相对的,0.5 表示没有变化,0 表示所有像素为黑色,1 表示所有像素为白色。

您也可以对任何 HSL 值使用 -1.0 以指定不更改。

By.一粒技术服务

results matching ""

    No results matching ""