How to Create Custom Color palette in Tableau – Part 2

In Part 1, we learned that in Tableau we can create two types of Color Palettes

  1. Regular – Used for Dimensions and Discrete Fields
  2. Sequential – Used for Measures or Continuous Fields

Creating Custom Sequential Color Palette:

Step 1: We have created the Custom Regular palette in

How to Create Custom Color palette in Tableau – Part 1

Continue the steps after this:

OR

Launch Tableau Desktop and Connect to ‘Sample Superstore Data.Xls’. Learn how to connect to excel data source

Step 2: Select the Orders table to create a Map – Use State from Dimensions and Sales from Measures.

Step 3: Create a Map using the above fields and place the Sales field to the Colors Shelf.

In the above sheet, you can observe Tableau by default allocates some Color Palette to the Map.

Step 4: We can change the color palette of Map, by clicking on Colors shelf and select the Edit Colors Option.

In the Palette option, we can see multiple Color palettes provided by Tableau. We can select any one from the list and assign to the Map.

If you don’t want to go with Tableau provided Color Palettes and would like to create your own custom palette, use Preferences.tps file.

Step 5: Save the Workbook and close Tableau Desktop.

Step 6: Navigate to ‘My Tableau Repository’ Folder under \ \Documents \My Tableau Repository, and open Preferences.tps in Notepad.

Note: This contains XML script. It can only be open in a text editor, such as Notepad.

Step 7: Use the following XML script to create Custom Color Palette using HTML codes of 6 Colors.

<?xml version=’1.0′?>

<workbook>

<preferences>

<color-palette name=”Custom Regular Palette” type=”regular” >

<color>#314d6a</color>

<color>#82a6bd</color>

<color>#ff5500</color>

<color>#bf8e5d</color>

<color>#197131</color>

<color>#6da964</color>

<color>#8a7322</color>

<color>#ffc156</color>

<color>#2c5e5a</color>

<color>#b50e1b</color>

<color>#bd5044</color>

<color>#744746</color>

<color>#383333</color>

<color>#ff963a</color>

<color>#4e79a7</color>

<color>#bab0ac</color>

<color>#d37295</color>

</color-palette>

<color-palette name=”Custom Sequential” type=”Ordered Sequential” >

<color>#eb912b</color>

<color>#eb9c42</color>

<color>#ebad67</color>

<color>#eabb86</color>

<color>#eacba8</color>

<color>#ebd8c2</color>

</color-palette>

</preferences>

</workbook>

Step 8: Copy the above Code into the preferences.tps file. Save and close the file.

Note: This code will create Custom Color Palette. Notice type= ”Ordered Sequential” this will create Sequential Color palette to be used with Continuous or Measure data elements.

*** We are adding the ordered sequential palette code to already existing regular type code. We can add as multiple color codes in the preferences.tps file.

Step 9: To see the Custom Color palette in Tableau, Close the Tableau desktop Application by saving the workbook and restart the application.

Open the saved workbook to apply Created Custom palette for the Map. Follow the same steps of Selecting the Colors Shelf and opening the Edit Colors Option.

Select the ‘Custom Color palette’ present at the bottom in the list of Palette option and assign the palette.

It Shows the below colors for the Map.

Please see step by step video below:

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *