Create Custom Color Palettes

Tableau Desktop comes with color palettes that have been carefully designed to work well together and effectively apply color to data in many situations, such as on maps, heatmaps, bar charts, etc. You can also create and use your own custom color palettes by modifying the Preferences.tps file that comes with Tableau Desktop. For example, you can create a custom categorical palette that matches your company's brand.

About the preferences file

You can add as many custom palettes as you like to your Preferences.tps file, each with as many colors as you want. Although there isn’t a limit to how many colors can be added to each custom palette, the Edit colors dialog box only shows 20 colors. If you need to manually assign more than 20 colors to data items, you may want to create several custom palettes with 20 or fewer colors in each palette.

When you modify Preferences.tps to add colors, use the standard HTML format for the new colors (hex code #RRGGBB or Red Green Blue format). When you save the workbook and restart Tableau Desktop, the color palette names you added to Preferences.tps appear in the Select Color Palette drop-down list (Edit Color dialog). You can use a custom palette like you would any other.

Tableau doesn't test or support custom color palettes, so be sure to back up your workbooks before you continue. Also, there is no guarantee that custom color palettes you create will work with future Tableau Desktop upgrades.

Note: When you edit your Preferences.tps file, be sure to use straight quotation marks (' ' or " ") to delimit the palette name and type, not curly quotation marks (“ ” or ‘ ’).

Edit the preferences file

The Preferences.tps file is located in the My Tableau Repository folder that is created when you install Tableau Desktop, likely located in Documents. The preferences file is a basic XML file that you can open in a text editor to modify. An unedited preferences file looks like this:

To edit your preferences file:

  1. Go to the My Tableau Repository folder in your Documents directory, and open the Preferences.tps file with a text editor.
  2. Between the opening and closing workbook tags, insert opening and closing preferences tags so that it looks like this:
    <?xml version='1.0'?>
    <workbook>
    <preferences>
    </preferences>
    </workbook>

    Note: If your Preferences.tps file already has preferences tags, you don't need to add them again.

  1. Follow one of the next procedures to create a custom color palette by inserting color-palette tags between the preferences tags. For example:
    <?xml version='1.0'?>	
    <workbook>
    <preferences>
    <color-palette name="MyColors" type="regular">
    <color>#1e4c56</color>
    <color>#cba94b</color>
    </color-palette>
    </preferences>
    </workbook>

    Color palettes can be categorical (type="regular"), sequential (type="ordered-sequential"), or diverging (type="ordered-diverging").

  2. To add more palettes, insert another set of color-palette tags.
    <?xml version='1.0'?>	
    <workbook>
    <preferences>
    <color-palette name="MyColors" type="regular">
    <color>#1e4c56</color>
    <color>#cba94b</color>
    </color-palette>
    <color-palette name="MoreColors" type="regular">
    <color>#ffe96f</color>
    <color>#799a0d</color>
    </color-palette>
    </preferences>
    </workbook>
  3. You must restart Tableau Desktop to see the new color palettes.

Create a categorical palette

A categorical color palette contains several distinct colors that can be assigned to discrete dimension members. For example, when you put a discrete dimension such as Region on the Color card, the categorical color legend is used.

In the preferences file, a categorical palette is type="regular".

Build a custom categorical color palette

Create a sequential palette

Another type of palette is the sequential color palette. This type of color palette is used for continuous fields, typically for measures. Typically, a sequential palette shows a single color, varying in intensity.

You must specify at least the two end colors in the sequential color range. Tableau will extrapolate the shades in between.

Build a custom sequential color palette

Create a diverging color palette

The third type of color palette is a diverging color palette. Instead of a gradient from one extreme to the other, a diverging palette is like two sequential palettes that share a color in the middle but have different extremes. This type of palette shows two ranges of values using color intensity (how dark or light) to show the magnitude of the number and the actual color (orange or blue) to show which range the number is from. Diverging palettes are most commonly used to show the difference between positive and negative numbers.

Build a custom diverging color palette

Use discontinued (classic) color palettes

In version 10.0, Tableau created new color palettes, updated some existing ones (such as Tableau 10 and Tableau 20), and discontinued others. If you want to keep using a color palette that was discontinued, you can edit your Preferences.tps file to add the hex values for the palette. You can add as many color palettes as you like.

Hex values for discontinued color palettes