How to create custom color palettes

Tableau Desktop offers color palettes that are designed to complement each other and suit various data visualization needs, such as maps, heat maps, and bar charts. You can also create and apply custom color palettes by editing the Preferences.tps file provided with Tableau Desktop. For example, you might design a custom categorical palette that aligns with your company’s brand.

About the Preferences File

You can add multiple custom palettes to your Preferences.tps file, each with any number of colors. While there’s no restriction on the number of colors per palette, the Edit Colors dialog box only displays up to 20 colors. If you need to manage more than 20 colors, consider creating multiple palettes with 20 or fewer colors each.

When adding colors to Preferences.tps, use standard HTML color formats (hexadecimal #RRGGBB or RGB format). After saving and restarting Tableau Desktop, your new palette names will appear in the Select Color Palette drop-down list in the Edit Color dialog box. You can then use these palettes as you would any other.

Tableau does not test or support custom palettes, so back up your workbooks before making changes. Also, custom palettes may not be compatible with future Tableau Desktop updates.

Editing the Preferences File

The Preferences.tps file is located in your My Tableau Repository folder. This XML file can be edited with a text editor. An unedited preferences file looks like this:

To modify your Preferences file:

  1. Go to the My Tableau Repository folder in your Documents directory and open the Preferences.tps file.
  2. Between the opening and closing workbook tags, insert opening and closing preferences tags, as shown: <?xml version='1.0'?> <workbook> <preferences> </preferences> </workbook>
  3. Follow the procedures to create a custom color palette.

Creating Custom Color Palettes

You can create:

  • Custom categorical color palettes
  • Custom sequential color palettes
  • Custom diverging color palettes

(Optional): Assign a Default Custom Palette

You can assign a default custom palette to dimensions and measures and publish it as a data source.

Using Discontinued (Classic) Color Palettes

In version 10.0, Tableau introduced new palettes, updated some existing ones, and discontinued others. To continue using a discontinued palette, add its hex values to your Preferences.tps file. You can include as many palettes as needed.

Restoring a Discontinued Palette

  1. Open the Preferences.tps file from the My Tableau Repository folder in your Documents directory.
  2. Insert the XML code for the discontinued palette between the preferences tags. For example: <color-palette name="Classic Blue Red 12" type="regular"> <color>#f4737a</color> <color>#bd0a36</color> <color>#ddc9b4</color> <color>#ac8763</color> <color>#b5dffd</color> <color>#6ba3d6</color> <color>#e9c39b</color> <color>#ac613c</color> <color>#ffb6b0</color> <color>#f02720</color> <color>#b5c8e2</color> <color>#2c69b0</color> </color-palette>
  3. Use straight quotation marks (‘ ‘ or ” “) for the palette’s name and type, not curly quotation marks (“ ” or ‘ ’).
  4. Save the Preferences.tps file and restart Tableau Desktop.

When you access the Edit Colors dialog box and select a color palette, the new palette will appear at the bottom of the list.

Hex Values for Discontinued Palettes

Here’s a table of discontinued color palettes with their XML code and hex values. If using the provided code, palette names will include “Classic” to denote their pre-version 10 status. Updated versions of some discontinued palettes are available.

[Table of discontinued palettes and their hex values continues as provided.]

You May Also Like