# percent-to-hex

> Converts percent value (between 0 and 1) to HEX color code (between green and red)

Latest version **1.0.1** (published 2020-10-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install percent-to-hex
pnpm add percent-to-hex
yarn add percent-to-hex
bun add percent-to-hex
```

## 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 | 2020-10-18 |
| First published | 2020-10-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Yevgen Shevchenko |
| Maintainers | commanddotcom |
| Keywords | hsl, hex, color, percent, visualization |

## Links

- npm: https://www.npmjs.com/package/percent-to-hex
- Repository: https://github.com/commanddotcom/percent-to-hex
- Homepage: https://github.com/commanddotcom/percent-to-hex#readme
- Issues: https://github.com/commanddotcom/percent-to-hex/issues
- npm.io page: https://npm.io/package/percent-to-hex

## Dependencies (2)

- [install](https://npm.io/package/install.md) ^0.13.0
- [hsl-to-hex](https://npm.io/package/hsl-to-hex.md) ^1.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

- 1.0.1 (latest) — 2020-10-18
- 1.0.0 — 2020-10-18

## README

# Percent to HEX package

Converts percent value (between 0 and 1) to HEX color code (between green and red)

### Install
`npm i percent-to-hex`

### Usage with default saturation (100%) and default lightness (50%)


``` 
const percentToHex = require('percent-to-hex');

percentToHex(1) // output: "#ff0000"
percentToHex(0.5) // output: "#ffff00"
percentToHex(0) // output: "#00ff00"
```

### Usage with custom saturation & lightness:

``` 
const percentToHex = require('percent-to-hex');

percentToHex([0.5,85,60]) // output: "#f0f042"
```

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