7 Tableau Color Tips
Here are some quick tips so you can make the most out of Tableau’s Color property.
#1 Show the color legend
If the color legend is not showing, or if we accidentally hide it, we can get it back by going to the Show/Hide cards button from the toolbar.
Note that the color legend *only* shows up if there is a field in the Color property.
#2 Know the color properties
Often people miss that the Color property has the options to add/remove border, color, transparency, as well as halo.
#3 Double click the color!
Double click the color in the legend to open the Edit Color window.
Double click on any color to select specific colors by using hex code, RGB code, or color picker.
#4 Use multiple discrete fields for Color
The default: Tableau allows use to have a single field in the Color property in the marks card. When you drop a second field onto Color, it replaces the field that used to be there.
The exception to this is if you want to use multiple discrete (blue) fields in Color. You can either:
drag both discrete fields to Color
drag the first discrete field to color, the second discrete field to Detail, and then on the Detail dropdown, switch to Color
#5 Create your own color palette
To create your own color palette, you will have to create a Preferences.tps file in your My Tableau Repository Folder.
This file is an XML (eXtensible Markup Language) which contains information about the colors you want in your palette.
A blank preferences file looks like this:
Within the <preferences> tags, you can add code for all the colors you want in your palette. Once you’ve added the code, your color palette dropdown will show your custom colors.
This is what a regular discrete color palette looks like:
This is what a sequential color palette looks like:
This is what a diverging color palette looks like:
#6 Create a transparent color
There are times when we just don’t want any color. Perhaps when we want to emphasize something in a highlight table.
There is an 8 bit hex code that allows for transparency. It’s called RGBA — or Red, Green, Blue, Alpha. The format in hex code would be #RRGGBBAA — where 00 is the lowest value (similar to none), and FF is the maximum value. For transparency (or alpha), 00 means invisible, and FF means visible.
Unfortunately the color palette in Tableau currently does not allow us to type the Alpha value in.
What we can do instead is to add this code to our Preferences file. Note in the example below, I am using #FFFFFF as the first six values which is white, but technically we can use any color since it’s transparent anyway.
For more in depth details and use cases, check out Tableau Visionary Kevin Flerlage’s post: Introducing the Transparent Color Hex Code in Tableau
#7 Test for accessibility and color blindness
Not everyone sees the same colors. Here are a couple of good introductory articles from We Are Colorblind.
There are many tools that can help us test how others may see our visualizations.
In Windows, I use ColorSimulations which provides real time simulation of color blindness.
Here are some additional tools you can explore:
Video Tutorial and more:
Here is the expanded video tutorial where I go through these tips in more detail:
For more Tableau tutorials, check out my YouTube channel.
Original Post in Medium