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 Office programs beginning with 2007 have a hidden capacity to display up to 50 custom colors. These form a new row below the theme colors and above the stock Microsoft row. Custom colors are not supported in PowerPoint 2008 or 2011 for OS X. While these versions will open a file with custom colors, the colors do not get added to the color picker. Here’s what the color picker in every other variety of Word or PowerPoint looks like after adding custom colors:
If you’re new to XML hacking, be sure to read my Introduction to the subject first. If you’re editing on a Mac, there are some other considerations covered in this article. I should also clarify: a Color Theme or a Font Theme are only sub-parts of a Theme as saved by PowerPoint. A PowerPoint Theme file contains the entire presentation, including masters, layouts, and full theme files. It’s this full theme file that we need to edit. Custom Colors never appear in a Color Theme file.
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 almost 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.
Setting Custom Colors
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/> self-closing tag. To add custom colors, we add a new branch to the tree. Below <a:extraClrSchemeLst/>, 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 partially ignored in Excel. In Excel, custom colors display for almost all objects on the Insert tab: Text Boxes, Shapes, SmartArt, Charts, WordArt, etc. But if you’re seeking to format worksheet text, cell fills or borders, custom colors do not show. (Thanks to reader Kaz for pointing this out.)
Custom Colors in Columns
By default, the colors appear in 5 rows of 10 colors each. Some designers prefer to display the colors in columns instead of rows. To work around this, add custom colors to form the top row of your columns. Then complete the row of 10 with dummy colors that have a value of FFFFFF and blank as a name:
Another limitation is that if you save a presentation as a Theme (*.thmx) file, custom colors in the presentation don’t get added to the Theme file. You’ll have edit a saved Theme file to add the custom colors to it, then they can be applied to another file. Or you can save the original presentation as a Presentation (*.pptx, *.pptm) or Template (*.potx, *.potm) to preserve the Custom Colors.
By extension, this also means that to add custom colors to Word by applying a PowerPoint Theme file, you must edit the Theme file to add the custom colors. Or course, you can hack the Word document or template to get them. The file name in Word will be the same: theme1.xml, but it is to be found in the word/themes folder instead of ppt/themes. As with PowerPoint, custom colors are added to the very end of the theme.xml part.
If you have added custom colors, then duplicate the slide master, the custom colors will also be duplicated (each slide master has a separate theme file as well). But if your first slide master has custom colors and you simply create a second slide master, the second master will not include the custom colors in it’s theme.
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.
I’ve written a lot about PowerPoint, but custom colors can be used anywhere in Word as well. In Excel, you get partial access. Most objects on the Insert tab can have custom colors applied, like AutoShapes and SmartArt. Custom colors cannot be used for worksheet formatting. Cell and font coloring won’t use use them, they just don’t appear in the color picker for those objects.
We’re here to do this for you, if you prefer! Please contact me at email@example.com. 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!