Questions from Tableau Training: How Can I Create Custom Color Palettes?


Questions from Tableau Training: How Can I Create Custom Color Palettes?

by Jon Bajon

Our Certified Tableau Trainers are asked a myriad of questions each day. In this series, they share some answers.

The latest question from Tableau Training comes from Andy, who was in a DII: Intermediate course in Toronto, Ontario.

“I need to match the colors on my charts to my company’s style guide. Is there a way specific colors can be chosen rather than the default palettes Tableau provides?”

Picking the right colors can often make the difference between a good visual and a great visual. There are a few different approaches we can take to help Andy out, so let’s jump right in!

The Quick Fix

Using the Sample – Superstore data set that ships with Tableau, let’s build a simple graph that we can splash with color. I chose Category and Sub-Category on rows and sum of Sales on columns. A quick descending sort by sum of Sales on Sub-Category gives me a nice starting point.

Simple graph

Above: Sub-Category sorted by descending sum of Sales.

Great! Now for the color. Let’s color each section of Category bars a different color to create a visual grouping. Dragging a copy of Category to color on the Marks card will do the trick.

Adding color

Above: Tableau automatically colors each section of the Category bars a color that matches the default palette.

Clicking the color option on the Marks card and choosing Edit Colors… grants the ability to select different colors. Notice that the colors are assigned based on how the categories are ordered. Furniture is blue since it’s the first color in the list, Office Supplies is orange because it’s the second in the list and Technology is red because it’s third.

If your business requires choosing different colors, Tableau provides many different palettes via the drop-down list at the top right. Just settle on a palette or two, click the data item you want to change then select the color.

Select Color Palette

Above: Colors can be mixed and matched from different color palettes.

If the colors you need can’t be found in Tableau’s provided list, you can double-click on the data item you want to change the color of to reveal the select color menu.

From this menu, you can be more specific with your color choices, with a wider range of hues and intensities along with the option to pick a color via RGB, HSV or HTML. You even have the option to pick from a screen color, which provides an eyedropper to match color somewhere else on your desktop. I find myself using this option most frequently to match logos and specific styles.

Select Color menu

Above: Double-click on a data item to get to the Select Color menu.

Once you make your color selection, you can choose to add it to custom colors to have quick access to it in the future. You’re limited to just 16 colors at a time this way, but that should be more than enough to get you started.

The Long-Term Fix

As great as the quick fix is, there are time you want to have a concrete set of options to choose from that don’t require you to have RGB codes handy every time you start Tableau. You might also want to be able to choose from different color palettes, which may require much more than the 16 allowed by the previous method.

Fortunately, with just a bit more time investment, we can set up our own permanent color palettes like the ones I have at the bottom of my select color palette list.

Color palettes

Above: PortalDemo, XYZ Insurance, Olympic Palette and IW Style Guide are all custom palettes I created and saved so that I have access to them in every workbook I open.

In order to do this on your own, we need to jump outside of Tableau for a moment. Navigate to your documents folder on your PC or Mac and locate a file called My Tableau Repository. Within that folder you should see a file at the bottom of the list called Preferences.tps.

This is a special file Tableau uses to read in custom color palettes. It will require some sort of document editor such as Notepad++ or Sublime Text to edit the Preferences file. Once the file is open, you can use standard HTML format to add in your new colors. See below for an example of my current Preferences file.

Preferences file

Above: Make sure to start and end your palettes with the appropriate beginning and closing tags and save the file before the palettes will appear in Tableau.

If you’re unfamiliar with using the style of coding above or your skills aren’t as good as they used to be, no worries; there is a great fix that will write all of the code for you leaving you to just copy and paste. If you haven’t heard of the Color Tool for Tableau, you’ve been missing out!

The Color Tool for Tableau was created by your friends here at InterWorks, so you know it’s gonna be legit/fantastic/revolutionary! Not only will the Color Tool for Tableau produce the code for you, it will generate a variety of color palette suggestions for single color and gradient palettes. It can even create the palettes based of an image which is great for businesses that don’t have a standard style guide. Best of all, the tool is free to use! Learn more and see some demos here.

Color Tool for Tableau

Fantastic! Now we know a couple of different ways to change the colors of our visualization within Tableau. Time to knock the socks off our colleagues in the next team meeting! Special thanks to Andy for the great question!

Want More Questions from Tableau Training

  1. Questions from Tableau Training: Quick Filter Interaction
  2. Questions from Tableau Training: Labeling with Table Calculations
  3. Questions from Tableau Training: Speeding Up Presentation Views when Using Tableau
  4. Questions from Tableau Training: Dashboard Actions
  5. Questions from Tableau Training: Business Day Calculations
  6. Questions from Tableau Training: Adding Gaps Between Bars
  7. Questions from Tableau Training: When to Pivot Data in Tableau
  8. Questions from Tableau Training: Adding Conditional Formatting
  9. Questions from Tableau Training: Setting Weekday Start
  10. Questions from Tableau Training: How Do ZIP Codes Work in Tableau?
  11. Questions from Tableau Training: The Small Grey Bar Within a Quick Filter
  12. Questions from Tableau Training: Matching Mark Color
  13. Questions from Tableau Training: Showing the Null Indicator
  14. Questions from Tableau Training: Can I Manually Set the Colors of a Stepped Gradient?
  15. Questions from Tableau Training: How Can I Get Box Plot Data into a Crosstab?
  16. Questions from Tableau Training: How Do I Clear a Worksheet? Make a Copy?
  17. Questions from Tableau Training: Opening URL Actions Inside of a Dashboard
  18. Questions from Tableau Training: Can I Move Mark Labels?
  19. Questions from Tableau Training: How Can I Use My Current Report to Create a Viz?
  20. Questions from Tableau Training: Can I Create Text Hyperlinks on a Dashboard?
  21. Questions from Tableau Training: How Can I Transform My Crosstab into a Flat List?
  22. Questions from Tableau Training: Labeling the Top N
  23. Questions from Tableau Training: How Can I Customize Charts with Parameters?
  24. Questions from Tableau Training: Combining Measures into a Single Line
  25. Questions from Tableau Training: How Can I Create Custom Color Palettes?
  26. Questions from Tableau Training: Can a Top N Parameter be Nested Within Other Fields?
  27. Questions from Tableau Training: Conditional Scope on Tableau Calculations
  28. Questions from Tableau Training: Top Ten Plus N
  29. Questions from Tableau Training: Dynamic Label Positioning
  30. Questions from Tableau Training: Using Cross Joins to Solve Active Tickets
  31. Questions from Tableau Training: Top N Highlight Table
  32. Questions from Tableau Training: How to Use Specific Dimensions in Table Calculations
  33. Questions from Tableau Training: Moving Reference Line Labels
  34. Questions from Training: Comparing Metrics for Same Weekday in Previous Year
  35. Questions from Tableau Training: Colouring Specific Columns and Rows in a Crosstab
  36. Questions from Tableau Training: Creating a Custom Legend as a Sheet
  37. Questions from Tableau Training: How Can I Draw a 45-Degree Angle?

More About the Author

Jon Bajon

Analytics Consultant
Tableau Viz: How Much Heat Can You Handle? It might sound controversial, but a common practice in my family (and many families throughout Louisiana) was something called ...
Questions from Tableau Training: Can a Top N Parameter be Nested Within Other Fields? The latest question from Tableau Training comes from Ryan, who was in a DII: Intermediate course in New York City. “I know I can ...

See more from this author →

Subscribe to our newsletter

  • I understand that InterWorks will use the data provided for the purpose of communication and the administration my request. InterWorks will never disclose or sell any personal data except where required to do so by law. Finally, I understand that future communications related topics and events may be sent from InterWorks, but I can opt-out at any time.
  • This field is for validation purposes and should be left unchanged.

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK