paletteer

🎨🎨🎨 Collection of most color palettes in a single R package

https://github.com/emilhvitfeldt/paletteer

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • β—‹
    CITATION.cff file
  • βœ“
    codemeta.json file
    Found codemeta.json file
  • β—‹
    .zenodo.json file
  • β—‹
    DOI references
  • β—‹
    Academic publication links
  • β—‹
    Committers with academic emails
  • β—‹
    Institutional organization owner
  • β—‹
    JOSS paper metadata
  • β—‹
    Scientific vocabulary similarity
    Low similarity (16.6%) to scientific vocabulary

Keywords

color-palette palettes r rstats

Keywords from Contributors

correlation spatial-analysis visualisation robust bayes-factors latex report ggplot-extension
Last synced: 9 months ago · JSON representation

Repository

🎨🎨🎨 Collection of most color palettes in a single R package

Basic Info
Statistics
  • Stars: 999
  • Watchers: 18
  • Forks: 49
  • Open Issues: 11
  • Releases: 10
Topics
color-palette palettes r rstats
Created almost 8 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog Contributing License

README.Rmd

---
output: github_document
---



```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)
```

# paletteer 


[![R-CMD-check](https://github.com/emilhvitfeldt/paletteer/workflows/R-CMD-check/badge.svg)](https://github.com/emilhvitfeldt/paletteer/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/paletteer)](https://cran.r-project.org/package=paletteer)
[![CRAN_Download_Badge](http://cranlogs.r-pkg.org/badges/paletteer)](https://CRAN.R-project.org/package=paletteer)
[![Codecov test coverage](https://codecov.io/gh/emilhvitfeldt/paletteer/branch/main/graph/badge.svg)](https://app.codecov.io/gh/emilhvitfeldt/paletteer?branch=main)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)


The goal of **paletteer** is to be a comprehensive collection of color palettes in R using a common interface. Think of it as the "caret of palettes".

**Notice** This version is not backwards compatible with versions <= 0.2.1. Please refer to the end of the readme for breaking changes

## Installation

You can install the released version of **paletteer** from [CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("paletteer")
```

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

```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("EmilHvitfeldt/paletteer")
```

## Palettes

The palettes are divided into 2 groups; *discrete* and *continuous*. For discrete palette you have the choice between the *fixed width palettes* and *dynamic palettes*. Most common of the two are the fixed width palettes which have a set amount of colors which doesn't change when the number of colors requested vary like the following palettes:

```{r echo=FALSE}
library(paletteer)
pals::pal.bands(
  paletteer_d("nord::frost"),
  paletteer_d("dutchmasters::milkmaid"),
  paletteer_d("LaCroixColoR::Lime"), 
  main = "Fixed width palettes",
  labels = c("nord\n frost", "dutchmasters\n milkmaid", "LaCroixColoR\n Lime")
  )
```

on the other hand we have the dynamic palettes where the colors of the palette depend on the number of colors you need like the `green.pal` palette from the `cartography` package:

```{r echo=FALSE}
pals::pal.bands(
  paletteer_dynamic("cartography::green.pal", 2),
  paletteer_dynamic("cartography::green.pal", 5),
  paletteer_dynamic("cartography::green.pal", 8),
  main = "Dynamic palettes",
  labels = c("cartography\n green.pal\n n = 2",
             "cartography\n green.pal\n n = 5",
             "cartography\n green.pal\n n = 6")
  )
```

Lastly we have the continuous palettes which provides as many colors as you need for a smooth transition of color:

```{r echo=FALSE}
library(paletteer)
pals::pal.bands(
  paletteer_c("viridis::inferno", 256),
  paletteer_c("grDevices::terrain.colors", 256),
  paletteer_c("scico::berlin", 256), 
  main = "continuous palettes",
  labels = c("viridis\n inferno", "grDevices\n terrain.colors", "scico\n berlin")
  )
```

This package includes `r nrow(palettes_c_names) + nrow(palettes_d_names) + nrow(palettes_dynamic_names)` palettes from `r length(unique(c(palettes_c_names$package, palettes_d_names$package, palettes_dynamic_names$package))) - 2` different packages and information about these can be found in the following data.frames: `palettes_c_names`, `palettes_d_names` and `palettes_dynamic_names`. Additionally this [github repo](https://github.com/EmilHvitfeldt/r-color-palettes) showcases all the palettes included in the package and more.

## Examples

All the palettes can be accessed from the 3 functions `paletteer_c()`, `paletteer_d()` and `paletteer_dynamic()` using the by using the syntax packagename::palettename.

```{r}
paletteer_c("scico::berlin", n = 10)
paletteer_d("nord::frost")
paletteer_dynamic("cartography::green.pal", 5)
```

All of the functions now also support tab completion to easily access the hundreds of choices

![](man/figures/paletteer-demo.gif)

## ggplot2 scales

Lastly the package also includes scales for `ggplot2` using the same standard interface

```{r}
library(ggplot2)

ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  geom_point() +
  scale_color_paletteer_d("nord::aurora")
```


## Palette explorer

A [web application](https://r-graph-gallery.com/color-palette-finder) is available to quickly explore the available palettes.

[![](man/figures/colorPaletteFinder.gif)](https://r-graph-gallery.com/color-palette-finder)


## Breaking changes

In version <= 0.2.1 a palatte was selected by specifying a `package` and `palette` argument like so

```{r, eval=FALSE}
paletteer_c(package = "nord", palette = "frost")
```

After version 0.2.1 palettes are selected using the syntax `"packagename::palettename"` inside the palette functions.

```{r, eval=FALSE}
paletteer_c("nord::frost")
```

## Special thanks

- [Hadley Wickham](https://github.com/hadley) For helpful code improvements.

## Included packages

**paletteer** includes palettes from the following packages:

```{r, echo=FALSE}
p_df <- paletteer_packages
p_df$Github <- ifelse(!is.na(paletteer_packages$Github),
                            paste0("[", paletteer_packages$Github, " - ", 
                            paletteer_packages$github_ver, "](https://github.com/", 
                            paletteer_packages$Github, ")"),
                            "-")

p_df$CRAN <- ifelse(paletteer_packages$CRAN,
  paste0("[", paletteer_packages$CRAN_ver, "](https://CRAN.R-project.org/package=", paletteer_packages$Name, 
                    ")"),
  "-")
p_df$CRAN[p_df$Name == "grDevices"] <- p_df$CRAN_ver[p_df$Name == "grDevices"]

knitr::kable(p_df[c("Name", "Github", "CRAN")])
```

Owner

  • Name: Emil Hvitfeldt
  • Login: EmilHvitfeldt
  • Kind: user
  • Location: California
  • Company: @posit-dev

All things @tidymodels

GitHub Events

Total
  • Issues event: 3
  • Watch event: 71
  • Issue comment event: 6
  • Fork event: 4
Last Year
  • Issues event: 3
  • Watch event: 71
  • Issue comment event: 6
  • Fork event: 4

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 240
  • Total Committers: 10
  • Avg Commits per committer: 24.0
  • Development Distribution Score (DDS): 0.063
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
EmilHvitfeldt e****t@g****m 225
Indrajeet Patil i****8@g****m 3
Yan Holtz y****a@g****m 2
Teun van den Brand t****d@g****m 2
Etienne Bacher 5****r 2
Matthew Leonawicz m****z@e****m 2
olivroy 5****y 1
Matthew J. Oldach m****6@g****m 1
DarΓ­o HereΓ±ΓΊ m****a@g****m 1
Cesar Luis Aybar Camacho a****4@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 111
  • Total pull requests: 14
  • Average time to close issues: 5 months
  • Average time to close pull requests: 19 days
  • Total issue authors: 37
  • Total pull request authors: 8
  • Average comments per issue: 0.95
  • Average comments per pull request: 0.64
  • Merged pull requests: 12
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 0
  • Average time to close issues: about 1 month
  • Average time to close pull requests: N/A
  • Issue authors: 5
  • Pull request authors: 0
  • Average comments per issue: 0.4
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • EmilHvitfeldt (59)
  • IndrajeetPatil (11)
  • ghost (2)
  • smach (2)
  • davidhodge931 (2)
  • verajosemanuel (2)
  • fkohrt (1)
  • modche (1)
  • IdoBar (1)
  • Nenuial (1)
  • werkstattcodes (1)
  • lopierra (1)
  • leonawicz (1)
  • Close-your-eyes (1)
  • olivroy (1)
Pull Request Authors
  • EmilHvitfeldt (7)
  • holtzy (2)
  • IndrajeetPatil (2)
  • teunbrand (2)
  • olivroy (2)
  • kant (1)
  • Ryo-N7 (1)
  • etiennebacher (1)
Top Labels
Issue Labels
new palettes (44) bug (6) documentation (1) enhancement (1)
Pull Request Labels

Packages

  • Total packages: 4
  • Total downloads:
    • cran 142,219 last-month
  • Total docker downloads: 11,564
  • Total dependent packages: 18
    (may contain duplicates)
  • Total dependent repositories: 47
    (may contain duplicates)
  • Total versions: 40
  • Total maintainers: 1
proxy.golang.org: github.com/emilhvitfeldt/paletteer
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 10 months ago
proxy.golang.org: github.com/EmilHvitfeldt/paletteer
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 10 months ago
cran.r-project.org: paletteer

Comprehensive Collection of Color Palettes

  • Versions: 11
  • Dependent Packages: 16
  • Dependent Repositories: 45
  • Downloads: 142,219 Last month
  • Docker Downloads: 11,564
Rankings
Stargazers count: 0.4%
Forks count: 1.6%
Downloads: 3.3%
Dependent repos count: 3.8%
Dependent packages count: 4.0%
Average: 5.7%
Docker downloads count: 21.1%
Maintainers (1)
Last synced: 10 months ago
conda-forge.org: r-paletteer
  • Versions: 9
  • Dependent Packages: 2
  • Dependent Repositories: 2
Rankings
Stargazers count: 14.5%
Dependent packages count: 19.6%
Average: 20.1%
Dependent repos count: 20.2%
Forks count: 26.3%
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • prismatic * imports
  • rematch2 * imports
  • rlang * imports
  • rstudioapi * imports
  • covr * suggests
  • gameofthrones >= 1.0.0 suggests
  • ggplot2 >= 3.3.0 suggests
  • ggthemes >= 4.0.0 suggests
  • harrypotter >= 2.1.0 suggests
  • knitr * suggests
  • oompaBase * suggests
  • palr * suggests
  • pals * suggests
  • rmarkdown * suggests
  • scico * suggests
  • testthat >= 2.1.0 suggests
  • vdiffr * suggests
  • viridisLite * suggests
.github/workflows/R-CMD-check-hard.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite