# colorutil

> RGB, HSL, HSV, HWB and more color models convertor

Latest version **4.1.2** (published 2018-04-12) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install colorutil
pnpm add colorutil
yarn add colorutil
bun add colorutil
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 4.1.2 |
| Published | 2018-04-12 |
| First published | 2017-09-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 25.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | caub |
| Maintainers | caub |
| Keywords | color, model, convert, RGB, HSL, HSV, HWB |

## Links

- npm: https://www.npmjs.com/package/colorutil
- Repository: https://github.com/caub/colorutil
- Homepage: https://github.com/caub/colorutil#readme
- Issues: https://github.com/caub/colorutil/issues
- npm.io page: https://npm.io/package/colorutil

## 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

- 4.1.2 (latest) — 2018-04-12
- 4.1.1 — 2018-04-12
- 4.1.0 — 2018-04-12
- 4.0.1 — 2018-04-12
- 4.0.0 — 2018-04-12
- 3.0.2 — 2017-10-19
- 3.0.1 — 2017-09-22
- 3.0.0 — 2017-09-20
- 2.0.0 — 2017-09-18

## README

## Color transforms between RGB, HSL, HSV and HWB, and more

[![npm version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![coverage status][codecov-image]][codecov-url]

sources:

* http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c
* http://alvyray.com/Papers/CG/hwb2rgb.htm

naming convention:

* foo2bar: input and output are in [0, 1]
* fooToBar: natural ranges: hues in [0, 360[, r/g/b in [0, 255], saturation/value/lightness in [0, 100]

The default export is a proxy, there are also [direct functions](https://unpkg.com/color-tf/) available

### Usage

```js
import colorTf from 'color-tf';
import hsl2hsv from 'color-tf/hsl2hsv';

colorTf.hslToRgb(200, 95, 62); // [ 66, 189, 250 ]
console.assert(hsl2hsv === colorTf.hsl2hsv);
```

[npm-image]: https://img.shields.io/npm/v/color-tf.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/color-tf
[travis-image]: https://img.shields.io/travis/caub/color-tf.svg?style=flat-square
[travis-url]: https://travis-ci.org/caub/color-tf
[codecov-image]: https://img.shields.io/codecov/c/github/caub/color-tf.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/caub/color-tf

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