# pixel-to-css-color

> convert a pixel ndarray to a css color string

Latest version **2.0.2** (published 2016-04-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install pixel-to-css-color
pnpm add pixel-to-css-color
yarn add pixel-to-css-color
bun add pixel-to-css-color
```

## 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 | 2.0.2 |
| Published | 2016-04-10 |
| First published | 2015-07-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | ahdinosaur |
| Maintainers | ahdinosaur |
| Keywords | color, css, hsl, hsla, keyword, ndpixels, pixel, rgb, rgba |

## Links

- npm: https://www.npmjs.com/package/pixel-to-css-color
- Repository: https://github.com/livejs/pixel-to-css-color
- Homepage: https://github.com/livejs/pixel-to-css-color#readme
- Issues: https://github.com/livejs/pixel-to-css-color/issues
- npm.io page: https://npm.io/package/pixel-to-css-color

## Dependencies (1)

- [generate-function](https://npm.io/package/generate-function.md) ^2.0.0

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

- 2.0.2 (latest) — 2016-04-10
- 2.0.1 — 2016-04-10
- 1.0.1 — 2015-07-30
- 1.0.0 — 2015-07-30

## README

# pixel-to-css-color

convert a [pixel ndarray](https://github.com/livejs/ndpixels) to a css color string

code stolen from [color-style](https://github.com/mattdesl/color-style/blob/master/index.js) and tests stolen from [array-to-css-color](https://github.com/tmpvar/array-to-css-color/blob/master/test.js)

## install

with [npm](https://npmjs.org) installed, run

```bash
npm i --save pixel-to-css-color
```

## usage

```
var ndarray = require('ndarray')
var toCss = require('pixel-to-css-color')

var pixel = ndarray([1, 2, 3])
pixel.format = 'rgb'
console.log(toCss(pixel)) // rgb(1, 2, 3)

// for raw performance
console.log(toCss.rgb(1, 2, 3)) // rgb(1, 2, 3)
```

## License

The Apache License

Copyright &copy; 2016 Michael Williams (@ahdinosaur)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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