# color-conversion

> transform color to any type such 'rgb' or 'hsl'

Latest version **1.0.1** (published 2016-12-27) · ISC license · 0 weekly downloads

## Install

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

## 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 | 1.0.1 |
| Published | 2016-12-27 |
| First published | 2016-12-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Joudee |
| Maintainers | joudee |

## Links

- npm: https://www.npmjs.com/package/color-conversion
- npm.io page: https://npm.io/package/color-conversion

## Recent versions

- 1.0.1 (latest) — 2016-12-27
- 1.0.0 — 2016-12-26

## README

# color-conversion

##Intention

JavaScript library for color conversion and manipulation with support for CSS color strings.

##Installation

```sh
npm install color-conversion
```

## Usage

```js
var Color = require("color-conversion")
```
or
```js
import Color from "color-conversion"
```

## Setters

The instance is tranforming RGB to HSL. You should use the 'toHSL' method.
```js
var color = Color("rgb(255, 255, 255)");  	//It's can write as var color = Color("255, 255, 255");
color.toHSL();  		//[3,0,100]
```
It's also can transform HSL to RGB(You should use the 'toRGB' method.),such as:
```js
var color = Color("hsl(100, 10%, 25%)");	//It's can write as var color = Color("100, 10%, 25%");
color.toRGB(); //[60,64,57]
```
Transforming hex to hsl or grb.
```js
var color = Color("ffffff");	//It's can write as var color = Color("#ffffff");
color.toRGB(); //[255,255,255]
color.toHSL(); //[100,0,100]
```


## Method
The library has three methods.That is [toRGB](),[toHSL]() and [toHex]().The method will return an array include the transformational color.

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