1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
<div id="pageData-showTOC" class="pageData">true</div>
<p>
A <em>theme</em> is a special kind of extension
that changes the way the browser looks.
Themes are <a href="packaging.html">packaged</a> like regular extensions,
but they don't contain JavaScript or HTML code.
</p>
<p>
You can find and try a bunch of themes at the
<a href="https://tools.google.com/chrome/intl/en/themes/">themes gallery</a>.
</p>
<h2> Manifest </h2>
<p>
Here is an example
<a href="manifest.html"><code>manifest.json</code></a>
file for a theme:
</p>
<p class="comment">
[PENDING: This page should eventually be (or point to) something
that's very friendly to artists.
You should only have to look at one page to create a theme.]
</p>
<pre>
{
"version": "2.6",
"name": "camo theme",
<b> "theme": {
"<a href="#images">images</a>" : {
"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"
},
"<a href="#colors">colors</a>" : {
"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]
},
"<a href="#tints">tints</a>" : {
"buttons" : [0.33, 0.5, 0.47]
},
"<a href="#properties">properties</a>" : {
"ntp_background_alignment" : "bottom"
}
}</b>
}
</pre>
<h3 id="colors">colors</h3>
<p>
Colors are in RGB format.
To find the strings you can use within the "colors" field,
look for kColor* strings in
<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/browser_theme_provider.cc"><code>browser_theme_provider.cc</code></a>.
</p>
<h3 id="images">images</h3>
<p>
Image resources use paths relative to the root of the extension.
You can override any of the images that are specified by
<code>kThemeableImages</code> in
<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/browser_theme_provider.cc"><code>browser_theme_provider.cc</code></a>.
Just remove the "IDR_"
and convert the remaining characters to lowercase.
For example, <code>IDR_THEME_NTP_BACKGROUND</code>
(which <code>kThemeableImages</code> uses
to specify the background of the new tab pane)
corresponds to "theme_ntp_background".
</p>
<h3 id="properties">properties</h3>
<p>
This field lets you specify
properties such as background alignment,
background repeat,
and an alternate logo.
To see the properties and the values they can have, see
<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/browser_theme_provider.cc"><code>browser_theme_provider.cc</code></a>.
<span class="comment"> [PENDING: We should flesh this out.] </span>
</p>
<h3 id="tints">tints</h3>
<p>
You can specify tints to be applied to parts of the UI
such as buttons, the frame, and the background tab.
Google Chrome supports tints, not images,
because images don't work across platforms
and are brittle in the case of adding new buttons.
To find the strings you can use within the "tints" field,
look for kTint* strings in
<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/browser_theme_provider.cc"><code>browser_theme_provider.cc</code></a>.
</p>
<p>
Tints are in Hue-Saturation-Lightness (HSL) format,
using floating-point numbers in the range 0 - 1.0:
</p>
<ul>
<li>
<b>Hue</b> is an absolute value, with 0 and 1 being red.
</li>
<li>
<b>Saturation</b> is relative to the currently provided image.
0.5 is <em>no change</em>,
0 is <em>totally desaturated</em>,
and 1 is <em>full saturation</em>.
</li>
<li>
<b>Lightness</b> is also relative,
with 0.5 being <em>no change</em>,
0 as <em>all pixels black</em>,
and 1 as <em>all pixels white</em>.
</li>
</ul>
<p>
You can alternatively use <code>-1.0</code> for any of the HSL values
to specify <em>no change</em>.
</p>
|