Tableau has many built-in color palettes that you can select from, but sometimes you might want to create a custom palette. Perhaps you're following brand guidelines, creating your own aesthetic, or theming your dashboard to go with the topic. Instead of manually typing in hex codes over and over again, you can create a custom palette to use and re-use in Tableau.
- Get the hex codes for the colors you want. These might be supplied to you if you're following branding guidelines, or you can use tools such as:
ImageColorPicker.com to pick from an image
Google Vision API to find the dominant colors in an image
Coolors to generate palettes and check for visibility with different types of color blindness
Canva Color Wheel to use color theory to generate complementary colors - Find your preferences.tps file on your computer. Just use your computer's built-in file search capabilities for this. You should find it in your "My Tableau Repository" folder.
- Open it in Notepad or another plain text editor.
If you've never edited it before, you'll see something like this:
You can replace the entire contents with the following, replacing the palette name and hex codes with your own:
<?xml version='1.0'?>
<workbook>
<preferences>
<color-palette name="My Custom Palette" type="regular">
<color>#02A7A0</color>
<color>#7CD3CB</color>
<color>#CED6BE</color>
<color>#FEBE42</color>
<color>#FFAF7E</color>
<color>#BF7C85</color>
</color-palette>
</preferences>
</workbook>
If you have already made changes to this file that you would like to preserve, then copy and paste the following somewhere between the preferences tags:
<color-palette name="My Custom Palette" type="regular">
<color>#02A7A0</color>
<color>#7CD3CB</color>
<color>#CED6BE</color>
<color>#FEBE42</color>
<color>#FFAF7E</color>
<color>#BF7C85</color>
</color-palette>
- Save the changes to this file and re-open Tableau. Once you drag a field onto the "Colors" card and click in to edit the colors, you'll see your custom palette is available following Tableau's built-in palettes.