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