# get-random-colors

> Provide a list of random colors in Hex, RGB, and HSL with adjustable intensity(1-100) as Parameters

Latest version **1.0.8** (published 2023-10-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install get-random-colors
pnpm add get-random-colors
yarn add get-random-colors
bun add get-random-colors
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2023-10-23 |
| First published | 2023-10-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | walid |
| Maintainers | wcawasa |
| Keywords | random colors, RGB, HSL, HEX color generator, randomize colors, get random colors, color randomizer, get-random-colors |

## Links

- npm: https://www.npmjs.com/package/get-random-colors
- Repository: https://github.com/koribot/getRandomColors
- Homepage: https://github.com/koribot/getRandomColors#readme
- Issues: https://github.com/koribot/getRandomColors/issues
- npm.io page: https://npm.io/package/get-random-colors

## 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.8 (latest) — 2023-10-23
- 1.0.7 — 2023-10-23
- 1.0.6 — 2023-10-20
- 1.0.5 — 2023-10-20
- 1.0.4 — 2023-10-20

## README

# getRandomColors

## Table of Contents

- [About](#about)
- [Getting Started](#getting-started)
  - [Installation](#installation)
- [Usage](#usage)
- [Examples](#example)



## About

Get a list of random colors with adjustable intensity (1-100) and the number of colors to generate.

**Returns:**

```json
{
  "hslColorLists": [],
  "rgbColorLists": [],
  "hexColorLists": []
}
```

## Getting Started
You can install it by downloading the source code or via npm

### Installation

```bash
npm i get-random-colors
``` 


## Usage

```bash
import {getRandomColors} from 'get-random-colors' # exact path node_modules/get-random-colors/src/lib/index.js
```

```bash
getRandomColors(50,6) # (intensity(1-100), numberofColorsToGenerate)
```


## Example

```bash
import {getRandomColors} from 'get-random-colors'


const random_colors = getRandomColors(20, 10)


console.log(random_colors)
console.log(random_colors.hslColorLists) # accessing hslColorLists array
console.log(random_colors.rgbColorLists) # accessing rgbColorLists array
console.log(random_colors.hexColorLists) # accessing hexColorLists array

```
**Sample Output**

```json
{
  "hslColorLists": [
    "hsl(84, 51%, 20%)",
    "hsl(132, 10%, 20%)",
    "hsl(274, 68%, 20%)",
    "hsl(45, 37%, 20%)",
    "hsl(61, 33%, 20%)",
    "hsl(355, 6%, 20%)",
    "hsl(95, 56%, 20%)",
    "hsl(266, 20%, 20%)",
    "hsl(232, 58%, 20%)",
    "hsl(42, 100%, 20%)"
  ],
  "rgbColorLists": [
    "rgb(56, 77, 25)",
    "rgb(46, 56, 48)",
    "rgb(56, 16, 86)",
    "rgb(70, 60, 32)",
    "rgb(67, 68, 34)",
    "rgb(54, 48, 48)",
    "rgb(46, 80, 22)",
    "rgb(50, 41, 61)",
    "rgb(21, 29, 81)",
    "rgb(102, 71, 0)"
  ],
  "hexColorLists": [
    "#384d19", "#2e3830",
    "#381056", "#463c20",
    "#434422", "#363030",
    "#2e5016", "#32293d",
    "#151d51", "#664700"
  ]
}

```

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