Jul 09, 2026 — Digital Edition
George Ideas
Independent Journalism & Insight
Feature

RColorBrewer: Colorblind-Friendly Palettes

In the realm of data visualization, choosing the right color palette is crucial. However, for those with color vision deficiency, or color blindness, certain color combinations can render data meaningless. This is where RColorBrewer, a package in the R programming language, comes to the rescue, offering colorblind-friendly palettes.

'Grab Coffee With Me' Color Palette
'Grab Coffee With Me' Color Palette

RColorBrewer is not just a collection of palettes; it's a tool that ensures your visualizations are accessible to everyone, including the roughly 4.5% of men and 0.4% of women with some form of color blindness. Let's delve into the world of RColorBrewer and explore how it can help create colorblind-friendly visualizations.

recolor - berry cola - no grayscale [ORIGINAL PHOTO IS NOT MINE!!]
recolor - berry cola - no grayscale [ORIGINAL PHOTO IS NOT MINE!!]

Understanding Color Vision Deficiency

Before we dive into RColorBrewer, it's essential to understand color vision deficiency. There are three types: red-green, blue-yellow, and complete color blindness. Each type perceives colors differently, making certain color combinations indistinguishable.

ྀི ͜𓈒 Tribbie’s coloring tutorial! 𝝑𝝔
ྀི ͜𓈒 Tribbie’s coloring tutorial! 𝝑𝝔

For instance, someone with red-green color blindness might struggle to tell the difference between red and green, or between blue and purple. This can significantly impact their ability to interpret visualizations that rely on color to convey information.

RColorBrewer's Palettes

colored pencils arranged in a circle on a white surface
colored pencils arranged in a circle on a white surface

RColorBrewer offers a suite of 8 color palettes, each designed to be colorblind-friendly. These palettes are categorized into two groups: qualitative and sequential. Qualitative palettes are used for categorical data, while sequential palettes are used for ordered data.

Each palette is carefully crafted to ensure that colors are distinguishable even to those with color vision deficiency. For example, the 'Set1' palette uses shades of blue, green, and purple, which are generally well-distinguished by those with red-green color blindness.

Implementing RColorBrewer in R

Color Combinaisons: Palette for Graphic Design #37
Color Combinaisons: Palette for Graphic Design #37

To use RColorBrewer, you first need to install and load the package. You can do this using the following commands:

install.packages("RColorBrewer")
library(RColorBrewer)

Once the package is loaded, you can access the palettes using the brewer.pal() function. For instance, to access the 'Set1' palette, you would use:

colors <- brewer.pal(8, "Set1")

This will return a vector of 8 colors that you can use in your visualization.

Modern Retro Industrial color palette
Modern Retro Industrial color palette

Testing Colorblind-Friendliness

RColorBrewer also provides a function called show.pal() that allows you to visualize the palettes and test their colorblind-friendliness. This function simulates what the palettes would look like to someone with different types of color vision deficiency.

platformówka
platformówka
Color Combinaisons: Palette for Graphic Design #193
Color Combinaisons: Palette for Graphic Design #193
😴💤
😴💤
Hornet Yellow & Galleon Blue
Hornet Yellow & Galleon Blue
Vintage Color Palette Prescribed. Smoky Blue, Dusty Rose, Warm Sand, Burnt Amber, Dark Tobacco.
Vintage Color Palette Prescribed. Smoky Blue, Dusty Rose, Warm Sand, Burnt Amber, Dark Tobacco.
Are You Actually Color-Blind?
Are You Actually Color-Blind?
Retro Clash
Retro Clash
Fresh Tones
Fresh Tones
#0ea7b3 · Color Palette
#0ea7b3 · Color Palette
B22 Design
B22 Design
a collage of green and yellow images with animals, plants, and swirls
a collage of green and yellow images with animals, plants, and swirls
Zombie Breath
Zombie Breath
an image of abstract art that looks like it has been created by using different colors and shapes
an image of abstract art that looks like it has been created by using different colors and shapes
the color chart for red, yellow, and blue in different colors with text below
the color chart for red, yellow, and blue in different colors with text below
Farrow & Ball Color Palette — Bancha & Arsenic & More Paint Colors
Farrow & Ball Color Palette — Bancha & Arsenic & More Paint Colors
Understanding Colour Blindness: Explore the 7 Different Types and How They Affect Vision
Understanding Colour Blindness: Explore the 7 Different Types and How They Affect Vision
a sheet of paper with different types of bears on it and the words berti coloring characters
a sheet of paper with different types of bears on it and the words berti coloring characters
watercolor and ink on paper with flowers
watercolor and ink on paper with flowers
Color Blind-Friendly Home Paint Guide | Tinted
Color Blind-Friendly Home Paint Guide | Tinted

For example, to test the 'Set1' palette, you would use:

show.pal(8, "Set1")

This will display the palette and show how it would appear to someone with normal vision, protanopia (red-green color blindness), deuteranopia (red-green color blindness), and tritanopia (blue-yellow color blindness).

Using RColorBrewer in ggplot2

RColorBrewer is particularly useful when used in conjunction with ggplot2, another popular R package for data visualization. ggplot2 allows you to specify the colors used in your plots, making it easy to incorporate RColorBrewer's palettes.

For instance, to create a bar plot using the 'Set1' palette, you could use the following code:

library(ggplot2)

ggplot(mtcars, aes(x = cyl, y = mpg, fill = cyl)) +
  geom_bar(stat = "identity", position = "fill") +
  scale_fill_brewer(palette = "Set1")

This will create a bar plot of miles per gallon (mpg) by number of cylinders (cyl), using the 'Set1' palette for the fill colors.

In the world of data visualization, accessibility is key. RColorBrewer is a powerful tool that ensures your visualizations are accessible to everyone, regardless of their color vision. By incorporating RColorBrewer into your visualization workflow, you can create more inclusive and engaging data visualizations.