random-color-generator-ts
v1.0.1
Published
Create a random color hex, hls, rgb and rgba
Downloads
23
Maintainers
Readme
🎨 Random Color Generator
This package provides utilities for generating random colors in various formats (HEX, RGB, RGBA, HSL, RGB with percentages) in JavaScript/TypeScript applications.
Installation
You can install the package via npm:
npm
npm install random-color-generator-ts
yarn
yarn install random-color-generator-ts
pnpm
pnpm add random-color-generator-ts
Usage
Generate Random Hex Color
Import the 'RandomHexColor' function from 'random-color-generator':
import { RandomHexColor } from 'random-color-generator';
console.log(RandomHexColor()); // Outputs a random color in hex format
Generate Random RGB
Import the 'RandomRgbColor' function from 'random-color-generator':
import { RandomRgbColor } from 'random-color-generator';
console.log(RandomRgbColor()); // Outputs a random color in RGB format
Generate Random RGBA Color
Import the 'RandomRgbaColor' function from 'random-color-generator':
import { RandomRgbaColor } from 'random-color-generator';
console.log(RandomRgbaColor()); // Outputs a random color in RGBA format
Generate Random HSL Color
Import the 'RandomHslColor' function from 'random-color-generator':
import { RandomHslColor } from 'random-color-generator';
console.log(RandomHslColor()); // Outputs a random color in HSL format
Generate Random RGB Percent Color
Import the 'RandomRgbPercentColor' function from 'random-color-generator':
import { getRandomRgbPercentColor } from 'random-color-generator';
console.log(getRandomRgbPercentColor()); // Outputs a random color in RGB percent format
Contributing and Issue Tracking
If you're interested in contributing to this project or want to report an issue, please check out our CONTRIBUTING.md guide for detailed information on how to get involved.
Code of conduct
Respect our CODE OF CONDUCT
License
This project is licensed under the MIT License - see the LICENSE file for details.