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

Colour Blind Friendly Colour Palettes in R

In the realm of data visualization, choosing the right color palette is crucial, especially for users with color vision deficiency. R, a popular programming language for statistical computing and graphics, offers a wide range of palettes, but not all are color blind friendly. Let's delve into the world of R's color palettes, focusing on those that are accessible to users with color blindness.

Color blind friendly palettes for data visualizations with categories
Color blind friendly palettes for data visualizations with categories

Color blindness, or color vision deficiency, affects approximately 4.5% of the global population. It's essential to ensure that our visualizations are inclusive and accessible to everyone. By using color blind friendly palettes in R, we can create graphs and charts that are easier to understand and interpret for all users.

Colorblind safe palette
Colorblind safe palette

Understanding Color Blindness

Before we dive into the palettes, it's crucial to understand the types of color blindness. The most common types are red-green color blindness (deuteranomaly and protanomaly) and blue-yellow color blindness (tritanomaly). Each type affects the way colors are perceived, making it challenging to distinguish between certain colors.

Colour Palette Ideas, Warm Colours, Spring Wedding Ideas, Color Scheme, Late Summer Wedding Colors, Enchanted Forest Color Palette, Vintage Color Palette, Wedding Colour Schemes, Summer Colour Palette
Colour Palette Ideas, Warm Colours, Spring Wedding Ideas, Color Scheme, Late Summer Wedding Colors, Enchanted Forest Color Palette, Vintage Color Palette, Wedding Colour Schemes, Summer Colour Palette

To create color blind friendly visualizations, we should aim to use colors that are distinct and easily distinguishable by people with color vision deficiency. This can be achieved by using tools and packages in R that help us create accessible color palettes.

R's Built-in Color Palettes

an image of different colors in the same color scheme
an image of different colors in the same color scheme

R comes with a wide range of built-in color palettes, but not all are color blind friendly. Some palettes, like "rainbow" or "viridis", use a sequence of colors that can be challenging for people with color blindness to distinguish. However, R also offers palettes specifically designed for color blind users, such as "brewer.pal" and "RColorBrewer".

To access these palettes, we can use the "RColorBrewer" package in R. This package provides a set of qualitative and sequential color palettes that are designed to be color blind friendly. The palettes are named after breweries, reflecting the package's creator, Cynthia Brewer. Some popular palettes from this package include "Set1", "Set2", and "Set3".

Creating Custom Color Palettes

the font and color scheme for this website
the font and color scheme for this website

While RColorBrewer provides a wide range of accessible palettes, there may be times when you need to create a custom palette. To ensure that your custom palette is color blind friendly, you can use tools like the Color Oracle or Coblis to test your color choices. These tools simulate color blindness and help you identify any potential issues with your palette.

In R, you can create custom palettes using the "RColorBrewer" package's "brewer.pal" function. This function allows you to create a custom palette based on an existing brewer palette, with a specified number of colors. By using this function, you can create a custom palette that is both accessible and tailored to your specific needs.

Using Color Blind Friendly Palettes in R

Colorblind Friendly Palette
Colorblind Friendly Palette

Now that we've discussed the types of color blindness and the palettes available in R, let's look at how to use these palettes in your visualizations. The key is to choose a palette that is color blind friendly and then apply it consistently throughout your visualization.

To apply a color blind friendly palette in R, you can use the "palette" function from the "grDevices" package. This function allows you to set the current palette, which can then be used in your visualizations. For example, to set the "Set1" palette from RColorBrewer, you would use the following code:

5 Colour Pallet Covers "Currywrust" Aesthetic Themed 馃挍
5 Colour Pallet Covers "Currywrust" Aesthetic Themed 馃挍
the color scheme for different colored lines
the color scheme for different colored lines
5 Tips on Designing Colorblind-Friendly Visualizations
5 Tips on Designing Colorblind-Friendly Visualizations
5 Colour Pallet Covers "Quercitron" Aesthetic Themed 馃挍
5 Colour Pallet Covers "Quercitron" Aesthetic Themed 馃挍
Guide to Color Blind Friendly Palettes | Yellowchalk Design
Guide to Color Blind Friendly Palettes | Yellowchalk Design
an image of a street sign with different colors on it and the words below it
an image of a street sign with different colors on it and the words below it
5 Colour Pallet Covers "Figue" Aesthetic Themed 馃挏馃挍
5 Colour Pallet Covers "Figue" Aesthetic Themed 馃挏馃挍
Color Combinaisons: Palette for Graphic Design #193
Color Combinaisons: Palette for Graphic Design #193
#a6d0e2 路 Color Palette
#a6d0e2 路 Color Palette
Goal color palette
Goal color palette
color swatches for the new york city subway system in pink, teal, and blue
color swatches for the new york city subway system in pink, teal, and blue
Color Palette #20 | Inspiration | Spring | Flowering | Forest | Green
Color Palette #20 | Inspiration | Spring | Flowering | Forest | Green
the color scheme for different colors is shown in this graphic diagram, which shows how each color
the color scheme for different colors is shown in this graphic diagram, which shows how each color
#0f6a80 路 Color Palette
#0f6a80 路 Color Palette
Color Palette 146
Color Palette 146
#b3a180 路 Color Palette
#b3a180 路 Color Palette
Spring Color Palette 馃帹 (Inspired by my Amazon SF curated Spring Edit List) 馃敆
Spring Color Palette 馃帹 (Inspired by my Amazon SF curated Spring Edit List) 馃敆
Color Combinaisons: Palette for Graphic Design #186
Color Combinaisons: Palette for Graphic Design #186
Color Combinaisons: Palette for Graphic Design #130
Color Combinaisons: Palette for Graphic Design #130
the color scheme for different font styles
the color scheme for different font styles

```r library(RColorBrewer) palette(brewer.pal(8, "Set1")) ```

Plotting with Color Blind Friendly Palettes

Once you've set your color blind friendly palette, you can use it in your plots. In R, you can create a wide range of plots using packages like "ggplot2" or "lattice". To use your custom palette in these plots, you can specify the "fill" or "color" aesthetic in your plot code.

For example, to create a bar plot using the "ggplot2" package and the "Set1" palette, you could use the following code:

```r library(ggplot2) ggplot(mpg, aes(x = displ, y = hwy, fill = class)) + geom_bar(stat = "identity", position = "dodge") + theme_minimal() ```

In this example, the "fill" aesthetic is used to specify the color of the bars in the plot. The "fill" aesthetic is mapped to the "class" variable, which determines the color of each bar. By using the "Set1" palette, we ensure that our plot is accessible to users with color vision deficiency.

Testing Your Visualizations

Once you've created your visualization, it's essential to test it to ensure that it is accessible to users with color blindness. You can use tools like the Color Oracle or Coblis to simulate color blindness and test your visualization. These tools allow you to see how your visualization would appear to someone with color vision deficiency, helping you identify any potential issues.

By testing your visualizations, you can ensure that they are accessible to all users, regardless of their visual abilities. This not only makes your visualizations more inclusive but also helps you create more effective and engaging data visualizations.

In the world of data visualization, choosing the right color palette is crucial for creating accessible and engaging visualizations. By using color blind friendly palettes in R, we can ensure that our visualizations are inclusive and accessible to users with color vision deficiency. Whether you're using R's built-in palettes or creating custom palettes, there are many tools and packages available to help you create color blind friendly visualizations. So, the next time you create a visualization in R, take a moment to consider the needs of your audience and choose a color palette that works for everyone.