munsell

munsell colour system for R

https://github.com/cwickham/munsell

Science Score: 23.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
    1 of 4 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.7%) to scientific vocabulary

Keywords

munsell-colour r
Last synced: 10 months ago · JSON representation

Repository

munsell colour system for R

Basic Info
  • Host: GitHub
  • Owner: cwickham
  • License: other
  • Language: HTML
  • Default Branch: master
  • Homepage:
  • Size: 22.6 MB
Statistics
  • Stars: 113
  • Watchers: 10
  • Forks: 9
  • Open Issues: 6
  • Releases: 3
Topics
munsell-colour r
Created over 17 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.Rmd

---
output: github_document
bibliography: vignette/intro/munsell.bib
---



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

![Downloads](http://cranlogs.r-pkg.org/badges/last-week/munsell)


  [![R-CMD-check](https://github.com/cwickham/munsell/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/cwickham/munsell/actions/workflows/R-CMD-check.yaml)


# munsell

The `munsell` package provides easy access to, and manipulation of, the  Munsell colours.  The `munsell` package provides a mapping between Munsell's original notation (e.g. "5R 5/10") and hexadecimal sRGB strings suitable for use directly in R graphics.  The package also provides utilities to explore slices through the Munsell colour tree, to transform Munsell colours and display colour palettes.

Munsell devised his system of colour notation to match the three perceptual dimensions of colour: hue, value and chroma.  His notation provides a naming scheme to colours that eases the choice of color according to a specific purpose.  His century old advice is still relevant for the producers of statistical graphics and the munsell package aims to enable user to easily follow it.

`munsell` relies directly on the published tables in @Newhall:1943aa of CIE XYZ (Illuminant C) values for Munsell colours. These tables were the result of colour matching studies on Munsell's color samples along with some smoothing and extrapolation with Munsell's goal of perceptually uniform spacing in mind.

Currently the `munsell` package only includes hue in steps of 2.5, value in steps of 2 and chroma in steps of 1, corresponding directly to the entries in Table 1 in @Newhall:1943aa. If you require a more continuous mapping, see [munsellinter](https://r-forge.r-project.org/projects/munsellinterpol/).


# Usage

Functions in `munsell` fall into three basic use categories: specifying Munsell colours, altering Munsell colours and exploring the Munsell color space.

The code below relies on the development version of `munsell`, get it with:
```{r, eval=FALSE}
devtools::install_github("cwickham/munsell")
```

## Color specification 

Following Munsell, specifying colours is done with a specific string format: "H V/C" where H is a hue code (see `mnsl_hues()` for a list of those available, excluding "N"), V an integer in $[0, 10]$ specifying value, and C an even integer specifying chroma. The `mnsl` function takes the string and returns a hexadecimal RGB representation: 
```{r, echo=TRUE}
library(munsell)
mnsl("5R 5/10")
```
Visually examining a colour can either be done by using `mnsl` with a base plotting call, or using `plot_mnsl` which plots colour swatches using `ggplot2`:
```{r, echo=TRUE, fig.keep='none', warning = FALSE}
plot.new()
rect(0, 0, 1 ,1 , col = mnsl("5R 5/10"))
plot_mnsl("5R 5/10")
```

## Colour manipulation
`munsell` provides convenience functions that alter a colour by taking  steps in the hue, value and chroma dimensions: `rygbp`, `pbgyr`, `lighter`, `darker`, `saturate` and `desaturate`.  

```{r manipulate-blue, fig.height = 4, fig.width = 4}
my_blue <- "5PB 5/8"
p <- plot_mnsl(c(
  lighter(my_blue, 2),      my_blue,   darker(my_blue, 2),
  desaturate(my_blue, 2),   my_blue,   saturate(my_blue, 2),
  rygbp(my_blue, 2),        my_blue,   pbgyr(my_blue, 2)))
p
```

Each function optionally takes the number of steps to take in the dimension and consequently are easily used to create scales in a particular dimension.  

```{r palette, results='markup', echo=TRUE, fig.height = 2, fig.width = 8}
p <- plot_mnsl(sapply(0:6, darker, col = "5PB 7/4"))
p + ggplot2::facet_wrap(~ num, nrow = 1)
```

## Colour space exploration

Slices through the colour space of constant hue, chroma or value can be displayed using the functions: `hue_slice`, `chroma_slice` and `value_slice`.  Additionally `complement_slice` displays a slice of constant hue, alongside a slice of its complement, the hue that is on the opposite side of the colour sphere to that specified.

```{r complement-slice, warning=FALSE, fig.width = 8, fig.height = 4}
complement_slice("5R")
```

# References

Owner

  • Name: Charlotte Wickham
  • Login: cwickham
  • Kind: user
  • Location: Corvallis, OR

GitHub Events

Total
  • Watch event: 3
Last Year
  • Watch event: 3

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 135
  • Total Committers: 4
  • Avg Commits per committer: 33.75
  • Development Distribution Score (DDS): 0.185
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Charlotte Wickham c****m@g****m 110
Charlotte Wickham w****c@s****u 15
hadley h****m@g****m 9
Tal Galili t****i@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 18
  • Total pull requests: 3
  • Average time to close issues: 5 months
  • Average time to close pull requests: about 1 year
  • Total issue authors: 6
  • Total pull request authors: 3
  • Average comments per issue: 0.72
  • Average comments per pull request: 0.67
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • cwickham (6)
  • hadley (5)
  • bryanhanson (4)
  • HenrikBengtsson (1)
  • rpietro (1)
  • sebastian-c (1)
Pull Request Authors
  • HenrikBengtsson (1)
  • talgalili (1)
  • bryanhanson (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 73,162 last-month
  • Total docker downloads: 201,321,586
  • Total dependent packages: 6
    (may contain duplicates)
  • Total dependent repositories: 117
    (may contain duplicates)
  • Total versions: 12
  • Total maintainers: 1
proxy.golang.org: github.com/cwickham/munsell
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.7%
Dependent repos count: 5.9%
Last synced: 10 months ago
cran.r-project.org: munsell

Utilities for Using Munsell Colours

  • Versions: 8
  • Dependent Packages: 6
  • Dependent Repositories: 117
  • Downloads: 73,162 Last month
  • Docker Downloads: 201,321,586
Rankings
Downloads: 0.3%
Dependent repos count: 1.9%
Stargazers count: 3.8%
Average: 6.3%
Dependent packages count: 7.1%
Forks count: 7.5%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • colorspace * imports
  • methods * imports
  • ggplot2 * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 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