Tableau Hack: Add a Custom Color Palette to Tableau

image generated by bing ai

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.

  1. 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
  2. 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.
    Screenshot 2024-01-23 165607.png
  3. Open it in Notepad or another plain text editor.

    If you've never edited it before, you'll see something like this:
    Screenshot 2024-01-23 170448.png
    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>
  4. 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.
    Screenshot 2024-01-23 172845.png
Author:
Cecily Santiago
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab