# colornames

> Map color names to HEX color values.

Latest version **1.1.1** (published 2016-01-24) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2016-01-24 |
| First published | 2013-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/colornames) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51 |
| Author | Tim Oxley |
| Maintainers | timoxley |
| Keywords | color, colour, names, css, hex, rgb, convert |

## Links

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

## 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.1.1 (latest) — 2016-01-24
- 1.1.0 — 2016-01-24
- 1.0.1 — 2015-12-29
- 1.0.0 — 2015-12-28
- 0.0.2 — 2013-07-30
- 0.0.0 — 2013-07-30

## README

# colornames

### Convert color names to HEX color values.

[![NPM](https://nodei.co/npm/colornames.png?downloads=true&downloadRank=true)](https://nodei.co/npm-dl/colornames/)
[![NPM](https://nodei.co/npm-dl/colornames.png?months=3&height=3&chrome)](https://nodei.co/npm/colornames/)

[![Build Status](https://travis-ci.org/timoxley/colornames.png?branch=master)](https://travis-ci.org/timoxley/colornames)
[![Dependency Status](https://david-dm.org/timoxley/colornames.png)](https://david-dm.org/timoxley/colornames)



## Installation

### Component
    $ component install timoxley/colornames

### Node/Browserify
    $ npm install colornames

## Example

```js
var toHex = require('colornames')
```

### VGA color names
```js
toHex('red') // => "#FF0000"
toHex('blue') // => "#0000FF"
```

### CSS color names
```js
toHex('lightsalmon') // => "#FFA07A"
toHex('mediumvioletred') // => "#C71585"
```

### Get meta data about a color
```js
toHex.get('red')
// =>
{
  name: "red",
  css: true,
  value: "#FF0000",
  vga: true
}
```

### Conversion is case-insensitive
```js
toHex('Blue') // => "#0000FF"
toHex('BLUE') // => "#0000FF"
toHex('BlUe') // => "#0000FF"
```

## API

### colornames(name)
Get HEX code for a color name, or `undefined` if unknown.

### .get(name)
All known data about color, including whether valid VGA or CSS color
name.

### .get.vga(name)
HEX code for a color name, only if the color is a valid VGA color
name.

### .get.css(name)
HEX code for a color name, only if the color is a valid CSS color
name.

###.all()
Get all color names data.

## License

  MIT

## Complete Color Map

![example-color-table-](https://f.cloud.github.com/assets/43438/643981/f57948a0-d381-11e2-99fd-197c44065564.png)

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