# js-colorize

> npm package for using hex colors with opacity

Latest version **1.1.4** (published 2022-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install js-colorize
pnpm add js-colorize
yarn add js-colorize
bun add js-colorize
```

## 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.1.4 |
| Published | 2022-06-24 |
| First published | 2022-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Muhammed Deniz |
| Maintainers | muhammeddeniz |
| Keywords | javascript, boilerplate, js, js module, boiler-plate, js-module, node, browser |

## Links

- npm: https://www.npmjs.com/package/js-colorize
- Homepage: https://github.com/muhammeddeniz/js-colorize#readme
- Issues: https://github.com/muhammeddeniz/js-colorize/issues
- npm.io page: https://npm.io/package/js-colorize

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.4 (latest) — 2022-06-24
- 1.1.3 — 2022-06-24
- 1.1.2 — 2022-06-24
- 1.1.1 — 2022-06-24
- 1.2.0 — 2022-06-24

## README

[![MIT License](https://img.shields.io/apm/l/atomic-design-ui.svg?)](https://github.com/tterb/atomic-design-ui/blob/master/LICENSEs)

# js-colorize

Helper funtions for color usage in js.

### Download

```sh
npm install js-colorize
```

or

```sh
yarn add js-colorize
```

### Usage

```js
import { hexWithAlpha } from "js-colorize";

// ...
var convertedColor = hexWithAlpha("#ffffff", 0.3);
//  'rgba(255, 255, 255, 0.3)'
```

### `hexWithAlpha`

| Usage                          | Hex                                                                           | Alpha | Result                   |
| ------------------------------ | ----------------------------------------------------------------------------- | ----- | ------------------------ |
| `hexWithAlpha("#0a192f", 0.3)` | <div style="background-color: #0a192f; widht: 20; height: 20" ></div> #0a192f | 0.3   | "rgba(10, 47, 25, 0.3)"  |
| `hexWithAlpha("#fac300", 0.7)` | <div style="background-color: #fac300; widht: 20; height: 20" ></div> #fac300 | 0.7   | "rgba(250, 0, 195, 0.7)" |

## Author

- Muhammed Deniz.

## Lisans

[MIT](https://choosealicense.com/licenses/mit/)

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