# colr-convert

> Color conversion functions

Latest version **1.0.5** (published 2015-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install colr-convert
pnpm add colr-convert
yarn add colr-convert
bun add colr-convert
```

## 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 | 2015-07-01 |
| First published | 2014-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | George Czabania |
| Maintainers | stayradiated |
| Keywords | color, convert, hsl, hex, hsv, hsb, rgb |

## Links

- npm: https://www.npmjs.com/package/colr-convert
- Repository: https://github.com/stayradiated/colr-convert
- Issues: https://github.com/stayradiated/colr-convert/issues
- npm.io page: https://npm.io/package/colr-convert

## 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) — 2015-07-01
- 1.0.4 — 2014-08-30
- 1.0.3 — 2014-08-30
- 1.0.2 — 2014-08-29
- 1.0.1 — 2014-08-28
- 1.0.0 — 2014-08-28

## README

colr-convert
============

> Color conversion functions.

This is a fork of https://github.com/harthur/color-convert.

The main changes are:

- Only supports RGB, HSV and HSL
- All functions return unrounded values
- Arguments must be passed in as an array
- Call functions like so `convert[from][to]([1, 2, 3]);`
- Adds hex/rgb conversion
- Adds grayscale/rgb conversion

**Note:** Recommend you do not use this library directly. Instead use
https://github.com/stayradiated/colr

## Benchmarks

```
grayscale2rgb x 41,237,487 ops/sec ±0.47% (99 runs sampled)
hex2rgb x 18,384,624 ops/sec ±0.24% (100 runs sampled)
rgb2grayscale x 42,660,769 ops/sec ±0.41% (101 runs sampled)
rgb2hex x 4,241,119 ops/sec ±0.30% (98 runs sampled)
rgb2hsv x 11,333,178 ops/sec ±0.35% (100 runs sampled)
rgb2hsl x 9,364,469 ops/sec ±0.30% (100 runs sampled)
hsl2rgb x 16,887,605 ops/sec ±0.38% (100 runs sampled)
hsl2hsv x 24,917,781 ops/sec ±0.66% (97 runs sampled)
hsv2rgb x 25,247,784 ops/sec ±0.44% (100 runs sampled)
hsv2hsl x 25,951,561 ops/sec ±0.98% (92 runs sampled)
Fastest is rgb2grayscale
```

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