GithubHelp home page GithubHelp logo

emilhvitfeldt / r-color-palettes Goto Github PK

View Code? Open in Web Editor NEW
1.4K 35.0 137.0 975.78 MB

Comprehensive list of color palettes available in R β€οΈπŸ§‘πŸ’›πŸ’šπŸ’™πŸ’œ

Home Page: https://EmilHvitfeldt.github.io/r-color-palettes/

R 74.51% Lua 17.41% EJS 3.13% SCSS 1.85% JavaScript 3.10%
rstats palette palettes palette-generation color color-palette r

r-color-palettes's Introduction

Comprehensive list of color palettes in r

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 [email protected].

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.

Paletteer package

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:

If you want the development version instead then install directly from GitHub:

Table of Contents

Blogposts and other resources

Here is a collection of material on the use and creation of color palettes in r.

Color manipulation packages

Generative packages

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.

When creating color palettes certain website have also provided valuable

Perception of color palettes

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

Printing in black and white

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.

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)

One of the continuous palette that satisfy this criteria is the well known viridis palettes.

To test if the palette you want to use will be distorted when in black and white, use the colorspace::desaturate() to desaturate it.

Color blindness

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. 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:

Another package that can provide helpful is the amazing colorblindr package that is able to simulate color blindness to ggplot objects them self.

Honorable mentions

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.

cpt-city

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")

sport colors

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.

Canva palettes

The ggthemes package include the 150 four-color palettes from the canva.com. Due to the size and limited number of colors in the palettes these palettes will be featured on their own page and only once.

Palettes sorted by Package (alphabetically)

# Developmental version
devtools::install_github("awhstin/awtools")

# Developmental version
devtools::install_github("riatelab/cartography")
# CRAN version
install.packages("cartography")

# CRAN version
install.packages("dichromat")

# Developmental version
devtools::install_github("EdwinTh/dutchmasters")

# Developmental version
devtools::install_github("road2stat/ggsci")
# CRAN version
install.packages("ggsci")

# Developmental version
devtools::install_github("gadenbuie/ggpomological")

# Developmental version
devtools::install_github("jrnold/ggthemes")
# CRAN version
install.packages("ggthemes")

# Developmental version
devtools::install_github("ewenme/ghibli")
# CRAN version
install.packages("ghibli")

# CRAN version
install.packages("grDevices")

the jcolors continuous palettes are currently not available in the paletteer package.

# Developmental version
devtools::install_github("jaredhuling/jcolors")
# CRAN version
install.packages("jcolors")

# Developmental version
devtools::install_github("johannesbjork/LaCroixColoR")

# Developmental version
devtools::install_github("m-clark/NineteenEightyR")

# Developmental version
devtools::install_github("jkaupp/nord")
# CRAN version
install.packages("nord")

# Developmental version
devtools::install_github("ropenscilabs/ochRe")
# CRAN version
install.packages("ochRe")

# CRAN version
install.packages("oompaBase")

# Developmental version
devtools::install_github("timcdlucas/palettetown")
# CRAN version
install.packages("palettetown")

# Developmental version
devtools::install_github("AustralianAntarcticDivision/palr")
# CRAN version
install.packages("palr")

# Developmental version
devtools::install_github("kwstat/pals")
# CRAN version
install.packages("pals")

# Developmental version
devtools::install_github("kwstat/pals")
# CRAN version
install.packages("pals")

# CRAN version
install.packages("Polychrome")

# Developmental version
devtools::install_github("EmilHvitfeldt/quickpalette")

# Developmental version
devtools::install_github("Nowosad/rcartocolor")
# CRAN version
install.packages("rcartocolor")

# CRAN version
install.packages("RColorBrewer")

# CRAN version
install.packages("Redmonder")

# Developmental version
devtools::install_github("alyssafrazee/RSkittleBrewer")

# Developmental version
devtools::install_github("thomasp85/scico")
# CRAN version
install.packages("scico")

# Developmental version
devtools::install_github("sjmgarnier/viridis")
# CRAN version
install.packages("viridis")

# Developmental version
devtools::install_github("karthik/wesanderson")
# CRAN version
install.packages("wesanderson")

# Developmental version
devtools::install_github("ndphillips/yarrr")
# CRAN version
install.packages("yarrr")

r-color-palettes's People

Contributors

dlaehnemann avatar emilhvitfeldt avatar gadenbuie avatar kylebutts avatar laurentgatto avatar spjpgrd avatar weiyangtham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

r-color-palettes's Issues

Add Okabe-Ito

Thank you for this resource - awesome list!

The 'Okabe-Ito' palette could be a good addition too perhaps?

Sort by Minimum Number of Colors Needed

I'm so happy that you made this website! Thank you!

As you solicited improvements as issues, I'm here to suggest one. It'd be great to be able to filter palettes by the minimum number of colors needed. Ideally an optional range could be provided (x > n > y) such that you could find color palettes with at least x colors but no more than y.

This would allow you to find color combinations that fit your data, while not having to experiment with gradient or other palettes that have way too many similarly colored options.

Sincerely,

A guy who has many datasets with > 20 localities, each of which needs its own color

palr

Love this project! I had no idea where to put my palettes so created palr. Very keen to consolidate

cartography palettes

The cartography package provides a set of palettes for thematic cartography purposes:

# Developmental version
devtools::install_github("riatelab/cartography")
# CRAN version
install.packages("cartography")

library(cartography)
display.carto.all()

pal

carto.pal() builds sequential, diverging or qualitative color palettes. Diverging color palettes can be dissymmetric (different number of colors in each of the two gradients).

shades package

The shades package may be of interest.

The shades package allows colours to be manipulated easily in R. Properties such as brightness and saturation can be quickly queried, changed or varied, and perceptually uniform colour gradients can be constructed. It plays nicely with the pipe operator from the popular magrittr package, and fits naturally into that paradigm.

New Palette Package?

Seems like it would be super helpful so consolidate these into a single package. Any plans to do so?

Add wavecolour

Hi Emil,
I've just finished a palette for wavelengths, wavecolour - the package also contains some functions for translating wavelengths into RGB and hex codes. Would be cool if you could add it to the list!
It is opinionated, and should only really be used for visualising visible light/wavelengths, I've tried to stress that point in the README. Thanks!
Mikkel

Palette Picker Site Suggestion: Add filter palette base on desired length

Hi this is my first time using this color palette feature and I feel helped with this feature.

But can I give a bit suggestion like add a feature to let us choose the color palette base on the color palette length ?
I think it will be useful if for example in my dataset I want to color the line graph with col base on A category column.
And in A category column consist of n unique value.
And if I use this feature, I will not troubled by counting the color palette length manually and also save time from error
cause by the color palette length are shorter than the category unique value.

And also consider this suggestion too: #50 (comment)
Or make the partition of color palette into multiple page with consist two container.

Upper container contain the color palette filter feature and Lower Container contain color palette page that have page slider in it
so that we can slide to other page without scrolling down and scrolling up too far.

And again. thanks for making Palette-Picker.

Palette picker site: Consider adding tooltip

I'm loving the palette picker!

I have one suggestion to make navigation a bit smoother. Right now one has to scroll down (a potentially long list of palettes), click on a palette, and then scroll up to the top of the page to see which package::palette combination they've just picked. I like that functionality, but it may be useful to also include a tooltip, such that when the mouse is over a particular palette, the {paletteer} function is displayed in an information bubble.

There are a few different ways of doing that from just html or css to JS. Some of the suggestions here seem like they'd be reasonably easy to implement, depending on how you built the site: https://stackoverflow.com/questions/11022843/add-hover-text-without-javascript-like-we-hover-on-a-users-reputation.

Again, thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.