# color-functions

> color functions for node and browser

Latest version **3.0.1** (published 2019-04-03) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install color-functions
pnpm add color-functions
yarn add color-functions
bun add color-functions
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2019-04-03 |
| First published | 2015-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 34.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Wang Zuo |
| Maintainers | adjusted |
| Keywords | color, css, functions, parse, parser, utilities |

## Links

- npm: https://www.npmjs.com/package/color-functions
- Repository: https://github.com/wangzuo/color-functions
- Homepage: https://github.com/wangzuo/color-functions#readme
- Issues: https://github.com/wangzuo/color-functions/issues
- npm.io page: https://npm.io/package/color-functions

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2019-04-03
- 3.0.0 — 2019-03-15
- 2.0.2 — 2019-03-14
- 2.0.1 — 2018-11-28
- 2.0.0 — 2018-11-28
- 1.2.0 — 2018-06-11
- 1.1.1 — 2018-06-07
- 1.1.0 — 2015-08-16
- 1.0.4 — 2015-08-14
- 1.0.3 — 2015-08-13
- 1.0.2 — 2015-05-27
- 1.0.1 — 2015-05-18
- 1.0.0 — 2015-05-18

## README

# color-functions

[![npm](https://img.shields.io/npm/v/color-functions.svg)](https://www.npmjs.com/package/color-functions)
[![npm](https://img.shields.io/npm/dm/color-functions.svg)](https://www.npmjs.com/package/color-functions)
[![Build Status](https://travis-ci.org/wangzuo/color-functions.svg?branch=master)](https://travis-ci.org/wangzuo/color-functions)
[![codecov](https://codecov.io/gh/wangzuo/color-functions/branch/master/graph/badge.svg)](https://codecov.io/gh/wangzuo/color-functions)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Greenkeeper badge](https://badges.greenkeeper.io/wangzuo/color-functions.svg)](https://greenkeeper.io/)

Color functions for node and browser (via `browserify`, `webpack`, ...)

### Installation

```sh
npm install color-functions --save
# or
yarn add color-functions
```

### Usage

```javascript
// commonjs
const { hex2rgb } = require('color-functions');

// es module
import { hex2rgb, cssColor } from 'color-functions';
import * as cf from 'color-functions';
```

### Available functions

- `cssColor`: parse a valid css [color value](https://developer.mozilla.org/en/docs/Web/CSS/color_value) to rgba format
- `hex2hsl`
- `hex2rgb`
- `hsl2hsv`
- `hsl2rgb`
- `hsv2hex`
- `hsv2hsl`
- `hsv2rgb`
- `rgb2hex`
- `rgb2hsv`
- `rgba`
- `rgba2hex`
- `rgba2rgb`

check [test](https://github.com/wangzuo/color-functions/blob/master/src/__tests__/index.js) for more examples

### License

MIT

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