The goal of this repository is to have a one stop destination for anyone looking for a color palette to use in r. If you would like to help/contribute please feel free post an issue, PR or send a email to emilhhvitfeldt@gmail.com.
Interactive R Color Palette Pickers:
Further down the page is all the palettes available in the R ecosystem ordered alphabetically by package name. A list of palettes ordered by type can be found here Type sorted palettes to shorten the length of this page.
I have collected all the palettes displayed here in a single package using a unified framework. Developmental version can be found here.
You can install the released version of paletteer from CRAN with:
install.packages("paletteer")If you want the development version instead then install directly from GitHub:
# install.packages("pak")
pak::pak("EmilHvitfeldt/paletteer")- Main page
- Blogposts and other resources
- Generative packages
- Honorable mentions
- Palettes sorted by Package (alphabetically)
- News
Here is a collection of material on the use and creation of color palettes in r.
- Creating corporate colour palettes for ggplot2
- Make your own color palettes with paletti
- How to create a color palette in R with more than 15 colors with ggplot2
- Generating a Custom Color Palette Function in R
- How to build a color palette from any image with R and k-means algo
- Why choice of colour is important beyond aesthtic considerations and how the quality of a palette might be assesed
- Viz palette: colors in action
- Extract palettes from images and text
- Fast Vectorised Colour Conversion and Comparison
- How to Read, Inspect, and Manipulate Color Swatch Files
- Simple colour manipulation in R
The purpose of this project is to showcase the palettes already available in R (packages). However sometimes you have to resort to make one yourself. When that is the case the following packages aides in creating.
- AndreaCirilloAC/paletter
- jolars/qualpalr
- ronammar/randomcoloR
- johnbaums/hues
- ColorPalette
- oaColors
- earthtones
- leeper/colourlovers
When creating color palettes certain website have also provided valuable
Selecting a color palette requires a number of different considerations. Within these considerations is
- the palette retains its integrity when printed in black and white
- people with colorblindness are able to understand it
In the following I have outlined a couple of those problems
While most of the palettes presented here contains a wide variety of colors. While that is compelling, you need to remember that your product might be printed in black and white one day, and you should pick a palette that allows for interpretation if that is the case.
First example is the rainbow palette from the grDevices package with
its colorful display. However as we see here would it be horrible if
used for black and white printing since different colors are mapped to
the same shade of grey.
source("palette_plotter.R")
pal_data <- list(
Normal = rainbow(32),
Desaturated = colorspace::desaturate(rainbow(32))
)
make_plot(pal_data, "readme-1")Standard rainbow palette
A related problem happens with the standard color palette used in
ggplot2 since that color is picked to have constant chroma and
luminance thus yielding the same shade of grey when desaturated. (This
palette is no longer the default for continuous variables in ggplot2
after version 3.0.0)
pal_data <- list(
Normal = scales::hue_pal()(256),
Desaturated = colorspace::desaturate(scales::hue_pal()(256))
)
make_plot(pal_data, "readme-2")Standard color palette for ggplot2
One of the continuous palette that satisfy this criteria is the well
known viridis palettes.
pal_data <- list(
Normal = viridis::inferno(256),
Desaturated = colorspace::desaturate(viridis::inferno(256))
)
make_plot(pal_data, "readme-3")inferno palette from viridis
To test if the palette you want to use will be distorted when in black
and white, use the colorspace::desaturate() to desaturate it.
Another thing you have to take into consideration when picking a palette is how it would be viewed by a person who is color blind. There are several approaches to ensuring that a colorblind person can interpret your figures. A very good summary of what you can do is given by Masataka Okabe and Kei Ito in their document βColor Universal Design (CUD) - How to make figures and presentations that are friendly to Colorblind peopleβ. Beyond using shapes, linetypes and size for information coding, which is easily done using the ggplot2 aesthetics, they recommend:
The easiest way to make color coding accessible to everyone, is using a palette, that is unambiguous to people with various types of color blindness. There are a few available:
- Masataka Okabe and Kei Ito have developed such a barrier free
palette, and you can use
it in R with the colorblind_pal() of the
ggthemespackage (also see colorblind_pal palette among the ggthemes palettes in the alphabetical list below) or by using the encoding provided by the Cookbook for R. - Some of the palettes developed by Cynthia Brewer for the
ColorBrewer are colorblind safe, you can
find them through the palette chooser websiteβs button βcolorblind
safeβ. In R, you can use the brewer palettes
through
ggplot2βs scale_colour_brewer() et al. or through the separate packageRColorBrewer.
To visualize the effect of color blindness on our palettes we will turn
to two packages. The dichromat package can simulate color blindness on
individual color and then also entire palettes like so in this rainbow
palette:
pal_data <- list(
Normal = rainbow(256),
Deuteranopia = dichromat::dichromat(rainbow(256), type = "deutan"),
Protanopia = dichromat::dichromat(rainbow(256), type = "protan"),
Tritanopia = dichromat::dichromat(rainbow(256), type = "tritan")
)
make_plot(pal_data, "readme-4")The effect of color blindness on the rainbow palette
Another package that can provide helpful is the amazing
colorblindr package that is
able to simulate color blindness to ggplot objects them self.
Due to the somehow vague notion of βcolor paletteβ have I decided to exclude certain kinds of packages from the main gallery. Generative package have been discussed earlier.
The amazing cpt-city is a wonderful project of creating an archive of color palettes to be used in cartography, technical illustration and design. Due to the immense size (7140) I have decided to refer to it instead of re-illustration them in this repository. If any of the palettes found here are for your liking they can be accessed in R using the following package:
# CRAN version
install.packages("cptcity")Many of the palettes in sports related palettes have a very limited number of colors (often only 2 colors). This leads to quite low usability outside of the special area of sports analytic.
-
colorr Color palettes for EPL, MLB, NBA, NHL, and NFL teams.
-
beanumber/teamcolors An R package providing color palettes for pro sports teams.
The ggthemes package include the 150 four-color palettes from the
canva.com. Doe to the size and limited number of colors in
the palettes these palettes will be featured on their own page and only
once.
# Developmental version
pak::pak("junqueiragaabi/ButterflyColors")# Developmental version
pak::pak("katiesaund/DresdenColor")# Developmental version
pak::pak("lambdamoses/IslamicArt")# Developmental version
pak::pak("johannesbjork/LaCroixColoR")# Developmental version
pak::pak("G-Thomson/Manu")# Developmental version
pak::pak("disarm-platform/MapPalettes")# Developmental version
pak::pak("BlakeRMills/MetBrewer")
# CRAN version
install.packages("MetBrewer")# Developmental version
pak::pak("paezha/MexBrewer")# Developmental version
pak::pak("BlakeRMills/MoMAColors")# Developmental version
pak::pak("kevinsblake/NatParksPalettes")
# CRAN version
install.packages("NatParksPalettes")# Developmental version
pak::pak("m-clark/NineteenEightyR")# Developmental version
pak::pak("jakelawlor/PNWColors")# CRAN version
install.packages("Polychrome")# Developmental version
pak::pak("nrennie/PrettyCols")
# CRAN version
install.packages("PrettyCols")# CRAN version
install.packages("RColorBrewer")# Developmental version
pak::pak("alyssafrazee/RSkittleBrewer")# Developmental version
pak::pak("nvietto/Rdune")
# CRAN version
install.packages("Rdune")# Developmental version
pak::pak("pmdci/redmonder")
# CRAN version
install.packages("Redmonder")# Developmental version
pak::pak("pdwaggoner/amerika")
# CRAN version
install.packages("amerika")# Developmental version
pak::pak("awhstin/awtools")# Developmental version
pak::pak("karoliskoncevicius/basetheme")
# CRAN version
install.packages("basetheme")# Developmental version
pak::pak("dill/beyonce")# Developmental version
pak::pak("ekholme/blueycolors")# Developmental version
pak::pak("an-bui/calecopal")# Developmental version
pak::pak("jacintak/colRoz")# CRAN version
install.packages("colorBlindness")# Developmental version
pak::pak("clauswilke/colorblindr")# CRAN version
install.packages("dichromat")# Developmental version
pak::pak("EdwinTh/dutchmasters")# Developmental version
pak::pak("shandiya/feathers")# Developmental version
pak::pak("nschiett/fishualize")
# CRAN version
install.packages("fishualize")# Developmental version
pak::pak("JoeyStanley/futurevisions")# Developmental version
pak::pak("gadenbuie/ggpomological")# Developmental version
pak::pak("csdaw/ggprism")
# CRAN version
install.packages("ggprism")# Developmental version
pak::pak("nanxstats/ggsci")
# CRAN version
install.packages("ggsci")# Developmental version
pak::pak("jrnold/ggthemes")
# CRAN version
install.packages("ggthemes")# Developmental version
pak::pak("Mikata-Project/ggthemr")# Developmental version
pak::pak("ewenme/ghibli")
# CRAN version
install.packages("ghibli")# CRAN version
install.packages("grDevices")# CRAN version
install.packages("impressionist.colors")# Developmental version
pak::pak("jaredhuling/jcolors")# Developmental version
pak::pak("tesselle/khroma")
# CRAN version
install.packages("khroma")# Developmental version
pak::pak("tylerlittlefield/lisa")
# CRAN version
install.packages("lisa")# Developmental version
pak::pak("loukesio/ltc-color-palettes")# Developmental version
pak::pak("EmilHvitfeldt/miscpalettes")# Developmental version
pak::pak("dawnbarlow/musculusColors")# Developmental version
pak::pak("katiejolly/nationalparkcolors")# Developmental version
pak::pak("murrayjw/nbapalettes")
# CRAN version
install.packages("nbapalettes")# Developmental version
pak::pak("jkaupp/nord")
# CRAN version
install.packages("nord")# Developmental version
pak::pak("hollylkirk/ochRe")# Developmental version
pak::pak("frareb/palettesForR")
# CRAN version
install.packages("palettesForR")# Developmental version
pak::pak("kwstat/pals")
# CRAN version
install.packages("pals")# Developmental version
pak::pak("jbgb13/peRReo")# Developmental version
pak::pak("laurenoconnelllab/poisonfrogs")
# CRAN version
install.packages("poisonfrogs")# Developmental version
pak::pak("Nowosad/rcartocolor")
# CRAN version
install.packages("rcartocolor")# Developmental version
pak::pak("johnmackintosh/rockthemes")# Developmental version
pak::pak("tomasokal/rtist")
# CRAN version
install.packages("rtist")# Developmental version
pak::pak("ivelasq/severance")# Developmental version
pak::pak("kaizadp/soilpalettes")# Developmental version
pak::pak("alburezg/suffrager")# Developmental version
pak::pak("asteves/tayloRswift")# Developmental version
pak::pak("business-science/tidyquant")
# CRAN version
install.packages("tidyquant")# Developmental version
pak::pak("leonawicz/trekcolors")
# CRAN version
install.packages("trekcolors")# Developmental version
pak::pak("Ryo-N7/tvthemes")
# CRAN version
install.packages("tvthemes")# Developmental version
pak::pak("hneth/unikn")
# CRAN version
install.packages("unikn")# Developmental version
pak::pak("cherylisabella/vangogh")
# CRAN version
install.packages("vangogh")# Developmental version
pak::pak("seasmith/vapeplot")# Developmental version
pak::pak("moldach/vapoRwave")# Developmental version
pak::pak("alexskeels/waRhol")# Developmental version
pak::pak("sciencificity/werpals")# Developmental version
pak::pak("karthik/wesanderson")
# CRAN version
install.packages("wesanderson")# Developmental version
pak::pak("ndphillips/yarrr")
# CRAN version
install.packages("yarrr")










































































