In my last post, I looked at adding extra color themes to PowerPoint masters. But any color theme can only hold a maximum of 10 colors (not counting the hyperlink colors, which are not available in the color picker). Sometimes designers create an expanded palette and they don’t like to be told “Sorry, we can only fit 10, we’ll have to throw out the rest.”, especially after the design has already been approved by the client.
Fortunately, most versions of PowerPoint have a hidden capacity to add up to 50 custom colors. These form a new row below the theme colors and above the stock Microsoft row. Oct.15, 2015 edit: Chris Robinson brought it to my attention that custom colors are not supported in PowerPoint 2008 or 2011 for OS X. While these versions will open a presentation with custom colors, the colors do not get added to the color picker. Here’s what the color picker in every other variety of PowerPoint looks like after adding custom colors:
As with the extra color themes we looked at last time, custom colors are added to the XML theme files found in ppt>theme. I mentioned in the last article, presentations always include a default Office theme as a fallback and this theme is always last in the list. So in a presentation with 1 color theme, there will be a theme1.xml and a theme2.xml inside the theme folder. Ignore theme2.xml and customize only theme1.xml.
Custom colors are the last category in a theme file, so it’s easy to find. As before, we expand the PowerPoint file (really a zip archive with a different file ending), open ppt/theme, open theme1.xml in a text editor and reflow the text to be humanly readable. Then scroll all the way down to the end. An unmodified file will only display the <a:extraClrSchemeLst/> stub to which you add custom color themes. To add custom colors, we add a new branch to the tree. Between <a:extraClrSchemeLst/> and </a:theme>, we type a new entry: <a:custClrLst>. This is followed by our custom color definitions and the closing tag </a:custClrLst>. Here’s what a list of custom colors as seen in the screenshot above would look like in XML:
A nice feature here is that, unlike color themes, you can actually supply a name for the color. This is followed a hexadecimal RGB color value, as used in web design. This list has only 8 colors, but there is room for up to 50 in the custom color area. If you read the last article about color themes, you’ll soon realize that each theme file can have a different set of custom colors that goes with it as well. The combination of themes and custom colors gives you 18 colors per theme to play with, almost enough for the most color-crazed designer.
Custom colors can be added to the theme1.xml file in Word and Excel using exactly the same syntax. The colors appear in the color picker as expected in Word but are completely ignored in Excel. It doesn’t complain or raise an error, it just won’t display anything but the standard color dialog. My thanks to Timothy Rylatt for pointing this out.
Another limitation is that custom colors do not travel with a presentation saved as a Theme (*.thmx) file. You’ll have to save as a Presentation (*.pptx, *.pptm) or Template (*.potx, *.potm) to preserve the Custom Colors. By extension, this also means that you cannot add custom colors to Word by applying a PowerPoint theme file. Instead, you must hack the Word document or template to get them.
Unlike theme colors, custom colors are not automatically applied to charts. Automatic chart coloring in PowerPoint, Excel and Word is limited to 6 settable colors (see this post for chart coloring details). After that, the host program starts generating automatic variants based on the theme. However, for the detail-oriented among us, manual recoloring of data series with custom colors is very convenient and miles above the previous technique, inputting RGB values from text.
Next time, I’ll tackle formatting custom table formats in XML. This is a complex subject, so it will take at least 2 posts. Stay tuned!