cols4all: introduction


Color is essential in many charts and maps. There are a lot of color palettes to choose from: most visualization software tools have their own palettes and there are many other series of color palettes, such as ColorBrewer (Harrower and Brewer, 2003). To make life easier for R users, there are a couple of packages that contain a large collection of palettes, most notably pals (Wright, 2021) with 139 and paletteer (Hvitfeldt, 2021) with 2569 (!) palettes. However, people often cannot see the trees through the forest, so therefore they tend to stick with the color palettes they know, or with the most popular ones.

The cols4all package also contains a large collection of palettes (to be precise 464 at the time of writing), but with the central question: which palettes are good and why? There is no simple answer, since there are many aspects to take into account, which may have opposite effects. In cols4all we examine the following aspects:

Currently, cols4all contains palettes from several popular and lesser known color palette series: “brewer”, “c4a”, “carto”, “hcl”, “kovesi”, “met”, “miscs”, “parks”, “poly”, “scico”, “seaborn”, “stevens”, “tableau”, “tol”, “viridis” , and “wes”. Stand-alone palettes that are included have been put in the series “misc” (miscellaneous). Own palettes series can be added as well.

Color palettes are organized and made consistent with each other. For instance, all sequential palettes go from light to dark. Furthermore, for each color palette a color for missing values is assigned, which is especially important for spatial data visualization. Currently we support several types: categorical (qualitative) palettes, sequential palettes, diverging palettes, and bivariate palettes (divided into four subtypes).