# is-contrast-checker

> Color palette combination contrast tester

Latest version **1.0.5** (published 2019-05-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-contrast-checker
pnpm add is-contrast-checker
yarn add is-contrast-checker
bun add is-contrast-checker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-05-14 |
| First published | 2019-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jameel Moses |
| Maintainers | jameelmoses |
| Keywords | color, contrast, wcag, accessibility |

## Links

- npm: https://www.npmjs.com/package/is-contrast-checker
- Repository: https://github.com/jameelmoses/is-contrast-checker
- Issues: https://github.com/jameelmoses/is-contrast-checker/issues
- npm.io page: https://npm.io/package/is-contrast-checker

## Dependencies (1)

- [color](https://npm.io/package/color.md) ^3.1.1

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2019-05-14
- 1.0.4 — 2019-05-14
- 1.0.3 — 2019-05-14
- 1.0.2 — 2019-05-14
- 1.0.1 — 2019-05-14
- 1.0.0 — 2019-05-14

## README

# IS Contrast Checker

Take a set color palette and get contrast values for every possible combination –
useful for finding safe color combinations with predefined colors
and includes pass/fail scores for the
[WCAG accessibility guidelines](http://www.w3.org/TR/WCAG20/#visual-audio-contrast).

## Getting Started

```bash
yarn add is-contrast-checker
```

## Usage

Pass an array of color strings or an object with color strings as values.

```js
import isContrastChecker from 'is-contrast-checker';

const colors = {
  red: '#f00',
  green: '#008000',
  white: '#fff'
}

const result = isContrastChecker(colors)
```

Returns an array of colors with combinations for all other colors and their
[WCAG contrast](http://www.w3.org/TR/WCAG20/#visual-audio-contrast)
values.

```json
[
  {
    "hex": "#FF0000",
    "name": "red",
    "labelColor": "white",
    "combinations": [
      {
        "hex": "#008000",
        "name": "green",
        "contrast": 1.28483997166146,
        "accessibility": "Fail"
      },
      {
        "hex": "#FFFFFF",
        "name": "white",
        "contrast": 3.9984767707539985,
        "accessibility": "AA18"
      }
    ]
  },
  ...
]
```

---

MIT License

---
_Source: https://npm.io/package/is-contrast-checker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
