Color is a powerful tool that impacts the way we interpret information. It creates atmosphere, focuses attention and suggests interpretation. Today I am going to explain how to become an expert in colors in Tableau and what tools can help you achieve it.
How are colors recorded in Tableau?
I have highlighted the importance of colors in data visualization on many occasions and will not touch on this topic today. I will focus on the methods that enable the developers to flexibly work with color. It is not only vital to understand the importance of color, but also to know how to put this knowledge into practice.
As always, you need to have sound basis. In Tableau, colors are recorded as numbers, for example #7fdeff is just one of many blue hues. The numbers represent the RGB system (RED-GREEN-BLUE), where each color is defined by the amount of red, green and blue light required to display it on the screen. This amount is measured for every hue in the scale from 0 to 255. This gives 256 options for every hue, which is 16 multiplied by 16. A hexadecimal system is used to save it. In addition to 0-9 numbers, the system also uses letters from A to F. This way, it is possible to put all color details in the RGB system using 6 characters. Our color contains 127 units of red, 222 units of green and 255 units of blue, which is saved as 7fdeff. A # sign is added, and the resulting code is #7fdeff. These colors and the corresponding codes are used to create palettes in Tableau.
Color palettes in Tableau
There are three types of palettes in Tableau: regular, ordered-diverging and ordered-sequential. Regular palettes consist of a list of colors. They can be applied to present dimensions or discrete measures. Ordered-diverging palettes usually consist of two or three colors and help make the transition between two colors such as red and green. The third, neutral color, such as grey or white, serves as the intermediate element. Order-sequential palettes use gradients as transitions between respective colors. The last two palettes can be used for continuous measures only.
Color palettes in Tableau can also be divided into two additional groups. The first group consists of palettes which you can see when you download the program for the first time or run the online version. In the second group, there are palettes which users can add themselves. How to add your own palette?
When you save Tableau Desktop on your computer disk, a My Tableau Repository catalogue is created. It is usually saved in Documents, but it’s not always the case. You can find the details of its location in Tableau Desktop by selecting File/ Repository Location from the top menu. The catalogue contains a file named Preferences.tps. Initially, it consists of several rows of the code only, but you can add more over time when you define new palettes. You can open and edit the Preferences.tps file using Notepad or similar.
It’s easy to recognize in the code of such a file that it contains color lists in the hexadecimal format. If you have a ready-to-use list of colors to be added to Tableau, you can enter them using the aforementioned formula. However, there is a simpler way to do this, but before I go into it in detail, I will briefly explain what to do when you don’t have your own color lists (such as corporate colors).
Where to get color palettes?
One option is to choose several colors and check their numbers using the Pick Screen Color option. However, the reality is more complex. Our eyes are used to the harmony of colors that exists in the nature. The best way to achieve it is to have plenty of elements and colors, as they balance each other out. In visualization, however, in it reasonable to adopt a limited range of colors. It must be well thought-out. Default palettes available in Tableau are very carefully selected, but you can design your palettes too.
There are lots of different tools available in the market to help you create color palettes. Below you will find my three favourite ones. Each tool is slightly different, but they have two things in common – they allow you to download a ready-to-use list of colors saved in the hexadecimal format. They also allow to check if a given set of colors is clearly recognizable by people with color vision deficiencies.
Paletton is number one on my list. It’s simple, intuitive and you don’t have to log in to use it. It allows you to choose several types of palettes and work with the color wheel. As a result, you will get a list of primary colors for your palette and matching secondary colors.
The next tool is Adobe Color. In addition to the options available in Paletton, it also allows you to create color palettes based on your own photographs or images. These palettes can either be in the form of a regular color list or can serve as colors for gradients. There is also a library of ready-to-use palettes and the option to calculate the contrast ratio. With this function, you can check if the text written using distinct colors will be readable. The software is available in Polish. Some options – including saving and exporting – are available after logging in.
The third recommendation is coolors.co. It offers the option to create your customized palettes, also on the basis of photographs. It allows to create effective photo and palette collages. There are quite a lot of functions available free of charge for logged in users. However, certain options are accessible for premium users, such as a contrast calculator.
How to add custom palettes in Tableau?
Most of the answer to this question should already be clear – you paste a fragment of the code containing color numbers to Preferences.tps. You can write the code on your own, but there is also a great tool that will help you do that – Color Tool for Tableau.
The tool is designed to generate color palettes based on photographs or create them based on specific parameters. In my opinion, however, the aforementioned tools seem to handle this task better. A great advantage of Color Tool is that it can automatically generate the code for the Preferences.tps file.
How to benefit from these tools? Let’s say that your company doesn’t have a defined marketing color palette, however the range of colors in the visualization should be associated with the company. You can use the colors available on the website – save a print screen in the form of an image and use it to create color palettes with the help of Adobe Color or coolors. The colors from the list can be pasted one by one into Color Tool. This way you can automatically generate the code to be pasted into Preferences.tps. It will contain more colors than the colors pasted and will also have more palettes that you may find unsuitable. However, it will be easier to further process it in the Notepad and remove the unnecessary elements.
As a result, your palettes will be accessible after you save the file with preferences and re-open Tableau.
Agata Mężyńska, Tableau Desktop Certified Professional