In this Level Up post, I’ll show you how to configure your preferences.tps file to add custom Tableau color palettes.
The Level Up series is designed to take Tableau beginners from out-of-the-box functionality to the next level of design and analytics, and features tip and tricks to make your dashboards more professional and polished. Click here to see all posts in the series.
There are some amazing tools for designing custom Tableau color palettes that members of the data community have created, and it’s been an especially popular topic recently. (Some of my favorites: Josh Tapley’s Color Palette Generator, Brittany Rosenau’s Palette Previewer, and – just for fun – Will Sutton’s Pokemon Color Schemes). In this post, we’ll go over everything you need to know about adding custom color palettes to your Tableau install.
(Note: I’ll be going over this in Windows, but the process should be very similar on any OS where Tableau can be installed).
Locate Your Tableau Repository
Custom color palettes live inside a preferences file in your Tableau repository, so the first thing you’ll need to do is find it! When you first download Tableau, the installer puts the repository in a default location. If you’re not sure where that is, the fastest option is to search your file system for “Tableau Repository”.
(If you’re using Tableau desktop and you don’t like the location of your repository, you can cut-and-paste the folder somewhere else and use the “Repository Location” in the file menu to reset it.)
Once you’ve found your repository folder, open it up. You’ll see something like this:
Edit Preferences.tps
The file we’re looking for is “Preferences.tps”. If you double-click to open directly, your OS will probably try to use Tableau to open it. This won’t work – we need it to open in a text editor. Right click, select “Open With”, and open with NotePad, WordPad, or whatever plain text editor you prefer.
The first time you open this preferences file, it looks pretty sparse. The first thing we need to do is tell Tableau we’re going to be adding some of our preferences, which we do by putting in an opening and closing “preferences” tag (<preferences> and </preferences>, respectively) between the two workbook tags.
Add a Custom Color Palette
Now we’re ready to add a color palette! In the space between the two preferences tags, you can add the following code:
<color-palette name="Desert" type="regular">
<color>#47231F</color>
<color>#341711</color>
<color>#752E29</color>
<color>#ECE2CC</color>
<color>#B2BAB2</color>
<color>#6A8C8E</color>
<color>#F9ECD0</color>
<color>#461612</color>
<color>#305057</color>
<color>#466971</color>
</color-palette>
This will add a nice desert-y rust brown and blue palette, but you can change the hex codes to be any colors that you want in the palette. You can also change the name as desired.
Within one palette, you can put as many colors as you like – however, note that Tableau will only display a max of 20 colors per palette. If you want to add more color palettes, you’ll repeat the whole section of code again while still inside the <preferences> tags. Here’s what my full file looks like with two color palettes:
Almost there! Save your file and restart Tableau. Now, when you use the drop-down color palette selector, you’ll see your new custom Tableau color palettes at the bottom of the list.
Inspiration
Here are a couple color palettes ready to be added in between the preferences tags in preferences.tps:
<color-palette name="Calm Neutrals" type="regular">
<color>#000000</color>
<color>#839788</color>
<color>#EEE0CB</color>
<color>#BAA898</color>
<color>#BFD7EA</color>
</color-palette>
<color-palette name="Turquoise Ocean" type="regular">
<color>#75DDDD</color>
<color>#508991</color>
<color>#172A3A</color>
<color>#004346</color>
<color>#09BC8A</color>
</color-palette>
<color-palette name="High Drama" type="regular">
<color>#0C1618</color>
<color>#004643</color>
<color>#FAF4D3</color>
<color>#D1AC00</color>
<color>#F6BE9A</color>
</color-palette>
I made all of these palettes with a tool that I love for exploring color schemes, Coolors. You can generate random palettes, use an image as a base, or create/edit palettes manually.
Now that you know how to create custom Tableau color palettes, the possibilities are endless! Get started making your own, and see how many beautiful combinations you can create.
Thank you for reading! Make sure to check out the rest of the level up series before you go, and subscribe to get notified of new posts.
Leave a Reply