colorblindcheck

Tools helping to decide if a color palette is colorblind friendly

https://github.com/nowosad/colorblindcheck

Science Score: 26.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
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.0%) to scientific vocabulary

Keywords

color-palette colors package r r-package rstats visualization
Last synced: 7 months ago · JSON representation

Repository

Tools helping to decide if a color palette is colorblind friendly

Basic Info
Statistics
  • Stars: 31
  • Watchers: 1
  • Forks: 3
  • Open Issues: 2
  • Releases: 0
Topics
color-palette colors package r r-package rstats visualization
Created almost 7 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Codemeta

README.Rmd

---
output: github_document
---



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


[![CRAN status](https://www.r-pkg.org/badges/version/colorblindcheck)](https://CRAN.R-project.org/package=colorblindcheck)
[![Codecov test coverage](https://codecov.io/gh/Nowosad/colorblindcheck/branch/master/graph/badge.svg)](https://app.codecov.io/gh/Nowosad/colorblindcheck?branch=master)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/colorblindcheck)](https://cran.r-project.org/package=colorblindcheck)
[![R-CMD-check](https://github.com/Nowosad/colorblindcheck/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Nowosad/colorblindcheck/actions/workflows/R-CMD-check.yaml)


Deciding if a color palette is a colorblind friendly is a hard task.
This cannot be done in an entirely automatic fashion, as the decision needs to be confirmed by visual judgments.
The goal of **colorblindcheck** is to provide tools to decide if the selected color palette is colorblind friendly, including:

- `palette_dist()` - Calculation of the distances between the colors in the input palette and between the colors in simulations of the color vision deficiencies: deuteranopia, protanopia, and tritanopia.
- `palette_plot()` - Plotting of the original input palette and simulations of color vision deficiencies: deuteranopia, protanopia, and tritanopia.
- `palette_check()` - Creating summary statistics comparing the original input palette and simulations of color vision deficiencies: deuteranopia, protanopia, and tritanopia.

The work in this package was inspired by a blog post [I wrote some code that automatically checks visualizations for non-colorblind safe colors. Here's how it works](https://www.vis4.net/blog/automate-colorblind-checking) by Gregor Aisch.

## Installation

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

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

You can install the development version of **colorblindcheck** from [GitHub](https://github.com/Nowosad/colorblindcheck) with:

```r
remotes::install_github("nowosad/colorblindcheck")
```

## Example

The **colorblindcheck** accepts a vector of hexadecimal color descriptions as the input. 
It can be created using different existing R functions (e.g. `rainbow()`) or packages (e.g. [**colorspace**](https://cran.r-project.org/package=colorspace), [**RColorBrewer**](https://cran.r-project.org/package=RColorBrewer), [**rcartocolor**](https://cran.r-project.org/package=rcartocolor), etc.).

```{r}
library(colorblindcheck)
rainbow_pal = rainbow(n = 7)
rainbow_pal
```

The primary function in this package is `palette_check()`, which creates a summary comparison between the original input palette and simulations of color vision deficiencies - deuteranopia, protanopia, and tritanopia.

```{r}
palette_check(rainbow_pal, plot = TRUE)
```

The `palette_check()` function returns a data.frame with 4 observations and 8 variables:

* `name`: original input color palette (normal), deuteranopia, protanopia, and tritanopia
* `n`: number of colors
* `tolerance`: minimal value of the acceptable difference between the colors to distinguish between them
* `ncp`: number of color pairs
* `ndcp`: number of differentiable color pairs (color pairs with distances above the tolerance value)
* `min_dist`: minimal distance between colors
* `mean_dist`: average distance between colors
* `max_dist`: maximal distance between colors

Additionally, a plot comparing the original input palette and simulations of color vision deficiencies - deuteranopia, protanopia, and tritanopia can be shown.
This help to decide if the selected color palette is colorblind friendly.

For example, the above output shows that the minimal distance between colors in the input palette is about 12; however, the minimum distance between colors simulation of tritanopia is only about 2.
It can suggest that some colors in this palette would not be distinguishable by people with color vision deficiencies.

The `palette_dist()` function calculates distances between the colors in the input palette, as well as in a simulation of the selected color vision deficiency - deuteranopia, protanopia, and tritanopia.
It allows finding which colors are the most or the least similar and to compare the behavior of color palettes for different color vision deficiencies.
In the original `rainbow_pal` object, the closest colors were the third and the fourth one (a distance of about 12); however, the protanopia version has a minimal distance of 3 between the second and third color.

```{r}
# normal
palette_dist(rainbow_pal)
# protanopia
palette_dist(rainbow_pal, cvd = "pro")
```

## References

- [Datawrapper now checks your colors, so you don’t have to](https://blog.datawrapper.de/colorblind-check/)
- [I wrote some code that automatically checks visualizations for non-colorblind safe colors. Here's how it works ](https://www.vis4.net/blog/automate-colorblind-checking)
- [Color Vision Deficiency Emulation](http://colorspace.r-forge.r-project.org/articles/color_vision_deficiency.html)
- [Delta E: The Color Difference](http://www.colorwiki.com/wiki/Delta_E:_The_Color_Difference)

Owner

  • Name: Jakub Nowosad
  • Login: Nowosad
  • Kind: user
  • Location: Poznań, Poland

Geocomputation, Pattern Analysis, Spatial Data Mining, Geostatistics, and R.

CodeMeta (codemeta.json)

{
  "@context": [
    "https://doi.org/10.5063/schema/codemeta-2.0",
    "http://schema.org"
  ],
  "@type": "SoftwareSourceCode",
  "identifier": "colorblindcheck",
  "description": "Compare color palettes with simulations of color vision deficiencies - deuteranopia, protanopia, and tritanopia.\n        It includes calculation of distances between colors, and creating summaries of differences between a color palette and simulations of color vision deficiencies.",
  "name": "colorblindcheck: Check Color Palettes for Problems with Color Vision Deficiency",
  "codeRepository": "https://github.com/Nowosad/colorblindcheck",
  "issueTracker": "https://github.com/Nowosad/colorblindcheck/issues",
  "license": "https://spdx.org/licenses/MIT",
  "version": "0.2.0",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.0.2 (2020-06-22)",
  "author": [
    {
      "@type": "Person",
      "givenName": "Jakub",
      "familyName": "Nowosad",
      "email": "nowosad.jakub@gmail.com",
      "@id": "https://orcid.org/0000-0002-1057-3721"
    }
  ],
  "contributor": {},
  "copyrightHolder": {},
  "funder": {},
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "Jakub",
      "familyName": "Nowosad",
      "email": "nowosad.jakub@gmail.com",
      "@id": "https://orcid.org/0000-0002-1057-3721"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "rcartocolor",
      "name": "rcartocolor",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rcartocolor"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "testthat",
      "name": "testthat",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=testthat"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "knitr",
      "name": "knitr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=knitr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rmarkdown",
      "name": "rmarkdown",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rmarkdown"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "covr",
      "name": "covr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=covr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "vdiffr",
      "name": "vdiffr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=vdiffr"
    }
  ],
  "softwareRequirements": [
    {
      "@type": "SoftwareApplication",
      "identifier": "colorspace",
      "name": "colorspace",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=colorspace"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "methods",
      "name": "methods"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "spacesXYZ",
      "name": "spacesXYZ",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=spacesXYZ"
    }
  ],
  "readme": "https://github.com/Nowosad/colorblindcheck/blob/master/README.md",
  "fileSize": "1703.475KB",
  "contIntegration": [
    "https://travis-ci.org/Nowosad/colorblindcheck",
    "https://codecov.io/gh/Nowosad/colorblindcheck?branch=master"
  ],
  "keywords": [
    "r",
    "package",
    "colors",
    "visualization"
  ],
  "citation": [
    {
      "@type": "SoftwareSourceCode",
      "datePublished": "2019",
      "author": [
        {
          "@type": "Person",
          "givenName": "Jakub",
          "familyName": "Nowosad"
        }
      ],
      "name": "Check Color Palettes for Problems with Color Vision Deficiency",
      "url": "https://nowosad.github.io/colorblindcheck",
      "description": "R package version 0.1.0"
    }
  ]
}

GitHub Events

Total
  • Watch event: 4
Last Year
  • Watch event: 4

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 67
  • Total Committers: 2
  • Avg Commits per committer: 33.5
  • Development Distribution Score (DDS): 0.015
Past Year
  • Commits: 3
  • Committers: 2
  • Avg Commits per committer: 1.5
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
Nowosad t****i@g****m 66
Florian Kohrt f****t@a****o 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 4
  • Total pull requests: 1
  • Average time to close issues: 4 days
  • Average time to close pull requests: 5 minutes
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 1.5
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: 1 day
  • Average time to close pull requests: 5 minutes
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Nowosad (2)
  • fkohrt (1)
  • codebam (1)
Pull Request Authors
  • fkohrt (2)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

DESCRIPTION cran
  • colorspace * imports
  • methods * imports
  • spacesXYZ * imports
  • covr * suggests
  • knitr * suggests
  • rcartocolor * suggests
  • rmarkdown * suggests
  • testthat * suggests
  • vdiffr * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite