# pretty-color

> color utils

Latest version **1.0.1** (published 2017-09-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install pretty-color
pnpm add pretty-color
yarn add pretty-color
bun add pretty-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 | 1.0.1 |
| Published | 2017-09-20 |
| First published | 2017-09-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | leevscript |
| Maintainers | leevscript |
| Keywords | color, pretty-color, transform, 颜色转换, 颜色差值 |

## Links

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

## 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.0.1 (latest) — 2017-09-20
- 1.0.0 — 2017-09-20

## README

## 颜色工具

> 安装

```
npm install pretty-color
```

> 使用

1. 引用
```
import Color from 'pretty-color'
```
或
```
<script src="pretty-color/dist/index.js"></script>
```
2. Color对象
+ Constructor
```
    Color(param[,rgb(a), number, string])
```
+ Methods
```
    toRgb(opaction) 转换成rgb(a)格式
```
```
    toHex() 转换成十六进制
```
```
    toDec() 转换成十进制
```
+ Examples
```js
var color = new Color('#ccc')
color.toRgb(0.3)  // => rgba(204,204,204,30)
var color = new Color('red')
color.toHex()     // => #FF0000
```

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