An open API service indexing awesome lists of open source software.

https://github.com/tmcw/deuteranopia

Simulate the prevalent deuteranopia form of colorblindness.
https://github.com/tmcw/deuteranopia

Last synced: 9 months ago
JSON representation

Simulate the prevalent deuteranopia form of colorblindness.

Awesome Lists containing this project

README

          

## deuteranopia

[![CircleCI](https://circleci.com/gh/tmcw/deuteranopia.svg?style=svg)](https://circleci.com/gh/tmcw/deuteranopia)

![](plate.jpg)

Simulate the prevalent deuteranopia form of colorblindness.

## API

#### Table of Contents

- [deuteranopia](#deuteranopia)
- [Parameters](#parameters)
- [Examples](#examples)

### deuteranopia

Simulate deuteranopia, the common form of colorblindness.

Based heavily off of [Color Oracle](http://colororacle.org/), which is in
turn based off of [Digital Video Colourmaps for
Checking the Legibility of
Displays by Dichromats](http://vision.psychol.cam.ac.uk/jdmollon/papers/colourmaps.pdf)

#### Parameters

- `rgb` **\[r, g, b]** Input color
- `rgb.0` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** red
- `rgb.1` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** green
- `rgb.2` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** blue

#### Examples

```javascript
deuteranopia([0, 20, 0]);
```

Returns **\[r, g, b]** simulated color