# colorconverterjs

> Color Conversion between Hex, RGB and CMYK

Latest version **0.1.1** (published 2013-12-26) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2013-12-26 |
| First published | 2013-12-26 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Felipe Sabino |
| Maintainers | felipesabino |

## Links

- npm: https://www.npmjs.com/package/colorconverterjs
- Homepage: http://felipesabino.github.io/colorconverter
- npm.io page: https://npm.io/package/colorconverterjs

## Recent versions

- 0.1.1 (latest) — 2013-12-26
- 0.1.0 — 2013-12-26

## README

# Color Converter

Easy color conversion between Hex, RGB and CMYK

## Instaling

```
// to-do
```

## Using

### Instance methods

```JavaScript
colorconverter.from_rgb({r: 10, g: 20, b:30 }).hex()
// "#0a141e"

colorconverter.from_hex('#0a141e').rgb()
// {r: 10, g: 20, b:30 }

colorconverter.from_hex('#8a796b').cmyk()
// {c: 0, m: 12, y: 22, k: 46 }

colorconverter.from_cmyk({c: 0, m: 12, y: 22, k: 46 }).hex()
// "#8a796b"
```

- Available methods

  - `hex()` - returns a string with a hexadecimal value
  - `rbg()` - returns an object with a RGB value
  - `cmyk()` - returns an object with a CMYK value

### Static methods

```JavaScript
colorconverter.rgb_to_hex({r: 10, g: 20, b:30 })
// "#0a141e"

colorconverter.hex_to_rgb('#0a141e')
// {r: 10, g: 20, b:30 }

colorconverter.hex_to_cmyk('#8a796b')
// {c: 0, m: 12, y: 22, k: 46 }

colorconverter.cmyk_to_hex({c: 0, m: 12, y: 22, k: 46 })
// "#8a796b"
```

- Available conversion methods

  - `rgb_to_hex(object)` - returns a string with a hexadecimal value for the RGB color object
  - `hex_to_rgb(string)` - returns an object with the RGB color values from a Hexadecimal string
  - `cmyk_to_hex(object)` - returns a string with a hexadecimal value for the CMYK color object
  - `hex_to_cmyk(string)` - returns an object with the CMYK color values from a Hexadecimal string

- Available helper methods

  - `from_hex(string)` - creates an instance of the converter using the hexadecimal value received as the seed
  - `from_rgb(object)` - creates an instance of the converter using the RGB object received as the seed
  - `from_cmyk(object)` - creates an instance of the converter using the CMYK object received as the seed

## Manually compile

configure:
```Shell
$ npm install
```

test:
```Shell
$ grunt test
```

compile:
```Shell
$ grunt build
```

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