Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koribot/getrandomcolors
A PACKAGE THAT return a list of random color -- params (intensity, numberOfColorToGenerate)
https://github.com/koribot/getrandomcolors
Last synced: 7 days ago
JSON representation
A PACKAGE THAT return a list of random color -- params (intensity, numberOfColorToGenerate)
- Host: GitHub
- URL: https://github.com/koribot/getrandomcolors
- Owner: koribot
- Created: 2023-10-18T16:03:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-23T06:06:17.000Z (about 1 year ago)
- Last Synced: 2024-04-24T03:23:43.120Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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"
]
}```