palettes

Methods for working with colour palettes in R

https://github.com/mccarthy-m-g/palettes

Science Score: 44.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.5%) to scientific vocabulary

Keywords

color-palette colors colour-palette colours ggplot2 gt palettes r r-package rstats vctrs
Last synced: 6 months ago · JSON representation ·

Repository

Methods for working with colour palettes in R

Basic Info
Statistics
  • Stars: 30
  • Watchers: 1
  • Forks: 2
  • Open Issues: 14
  • Releases: 4
Topics
color-palette colors colour-palette colours ggplot2 gt palettes r r-package rstats vctrs
Created over 4 years ago · Last pushed 8 months ago
Metadata Files
Readme Changelog License Citation

README.Rmd

---
output: github_document
always_allow_html: true
---



```{r, include = FALSE, cache = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  cache = FALSE,
  asciicast_theme = "pkgdown"
)
asciicast::init_knitr_engine(
  startup = quote({
    library(tibble)
    library(palettes)
    set.seed(1) }),
  echo = TRUE,
  echo_input = FALSE
)
```

# palettes 


[![R-CMD-check](https://github.com/mccarthy-m-g/palettes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mccarthy-m-g/palettes/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/mccarthy-m-g/palettes/graph/badge.svg)](https://app.codecov.io/gh/mccarthy-m-g/palettes)
[![CRAN status](https://www.r-pkg.org/badges/version/palettes)](https://CRAN.R-project.org/package=palettes)
[![R-universe status](https://mccarthy-m-g.r-universe.dev/badges/palettes)](https://mccarthy-m-g.r-universe.dev/palettes)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/grand-total/palettes)](https://cran.r-project.org/package=palettes)


palettes is an R package for working with colour vectors and colour palettes. There are three main goals to the palettes package, each described in a vignette:

- To provide a new family of colour classes (`palettes_colour` and `palettes_palette`) that always print as hex codes with colour previews; `vignette("palettes")`.

- To provide a comprehensive library of methods for working with colour vectors and colour palettes, including methods for ggplot2, `vignette("ggplot2")`; gt, `vignette("gt")`; biscale, `vignette("biscale")`; and other colour packages, `vignette("compatibility")`.

- To make it easy for anyone to make their own colour palette package; `vignette("creating-packages")`. Colour palette packages made with palettes exist solely for the purpose of distributing colour palettes and get access to all the features of palettes for free.

## Installation

Install palettes from [CRAN](https://CRAN.R-project.org/package=palettes) with:

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

Install the development version from [GitHub](https://github.com/mccarthy-m-g/palettes) or [R-universe](https://mccarthy-m-g.r-universe.dev/palettes) with:

```r
# Install from GitHub
# install.packages("remotes")
remotes::install_github("mccarthy-m-g/palettes")

# Install from R-universe
install.packages("palettes", repos = "https://mccarthy-m-g.r-universe.dev")
```

Install the [WebAssembly](https://webassembly.org) version for use in [WebR](https://docs.r-wasm.org/webr/latest/) applications with:

```r
# Install CRAN version from r-wasm
install.packages("palettes", repos = "https://repo.r-wasm.org")

# Install development version from R-universe
install.packages(
  "palettes",
  repos = c("https://mccarthy-m-g.r-universe.dev", "https://repo.r-wasm.org")
)
```

## Usage

```{r}
library(palettes)
```

Colours can be specified by name (as listed by `grDevices::colours()`):

```{asciicast pal-colour-character}
pal_colour("red")
```

Or by hex code:

```{asciicast pal-colour-hex}
pal_colour("#FF0000")
```

Multiple colours can be specified at once as a character vector:

```{asciicast pal-colour-vector}
pal_colour(c("#a00e00", "#d04e00", "#f6c200", "#0086a8", "#132b69"))
```

Named colour palettes can be specified in the same way:

```{asciicast pal-palette}
pal_palette(
  egypt = c("#dd5129", "#0f7ba2", "#43b284", "#fab255"),
  java  = c("#663171", "#cf3a36", "#ea7428", "#e2998a", "#0c7156")
)
```

Colours also print nicely in tibbles:

```{asciicast tibble}
as_tibble(pal_colour(c("#dd5129", "#0f7ba2", "#43b284", "#fab255")))
```

## Documentation

See at [`https://mccarthy-m-g.github.io/palettes/`](https://mccarthy-m-g.github.io/palettes/reference/index.html) and also in the installed package: `help(package = "palettes")`.

## License

MIT © Michael McCarthy

Owner

  • Name: Michael McCarthy
  • Login: mccarthy-m-g
  • Kind: user

Data Scientist solving problems you care about

Citation (CITATION.cff)

cff-version: 1.2.0
message: 'To cite package "palettes" in publications use:'
type: software
license: MIT
title: 'palettes: Methods for Colour Vectors and Colour Palettes'
abstract: 'Provides a comprehensive library for colour vectors and colour palettes
  using a new family of colour classes (palettes_colour and palettes_palette) that
  always print as hex codes with colour previews. Capabilities include: formatting,
  casting and coercion, extraction and updating of components, plotting, colour mixing
  arithmetic, and colour interpolation.'
authors:
- family-names: McCarthy
  given-names: Michael
repository: https://CRAN.R-project.org/package=palettes
repository-code: https://github.com/mccarthy-m-g/palettes
url: https://mccarthy-m-g.github.io/palettes/
version: 0.1.1
date-released: 2023-01-12

GitHub Events

Total
  • Create event: 2
  • Release event: 1
  • Issues event: 1
  • Watch event: 8
  • Issue comment event: 3
  • Push event: 3
  • Pull request event: 3
Last Year
  • Create event: 2
  • Release event: 1
  • Issues event: 1
  • Watch event: 8
  • Issue comment event: 3
  • Push event: 3
  • Pull request event: 3

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 35
  • Total pull requests: 22
  • Average time to close issues: 3 months
  • Average time to close pull requests: 1 day
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 0.49
  • Average comments per pull request: 0.09
  • Merged pull requests: 20
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 8
  • Average time to close issues: about 1 hour
  • Average time to close pull requests: 2 days
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.13
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mccarthy-m-g (33)
  • EllaKaye (2)
Pull Request Authors
  • mccarthy-m-g (18)
  • teunbrand (2)
  • olivroy (2)
Top Labels
Issue Labels
enhancement (18) documentation (7) bug (2) help wanted (2)
Pull Request Labels
documentation (2) enhancement (2)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 320 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 5
  • Total maintainers: 1
cran.r-project.org: palettes

Methods for Colour Vectors and Colour Palettes

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 320 Last month
Rankings
Stargazers count: 19.3%
Forks count: 21.0%
Dependent repos count: 24.0%
Average: 26.4%
Dependent packages count: 28.8%
Downloads: 39.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • cli * imports
  • colorspace * imports
  • ggplot2 * imports
  • glue * imports
  • methods * imports
  • pillar * imports
  • prismatic * imports
  • purrr * imports
  • rlang * imports
  • vctrs * imports
  • pkgdown * suggests
  • testthat >= 3.0.0 suggests
.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/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