This package provides utilities for generating random colors in various formats (HEX, RGB, RGBA, HSL, RGB with percentages) in JavaScript/TypeScript applications.
You can install the package via npm:
npm install random-color-generator-ts
yarn install random-color-generator-ts
pnpm add random-color-generator-ts
Import the 'RandomHexColor' function from 'random-color-generator':
import { RandomHexColor } from 'random-color-generator';
console.log(RandomHexColor()); // Outputs a random color in hex format
Import the 'RandomRgbColor' function from 'random-color-generator':
import { RandomRgbColor } from 'random-color-generator';
console.log(RandomRgbColor()); // Outputs a random color in RGB format
Import the 'RandomRgbaColor' function from 'random-color-generator':
import { RandomRgbaColor } from 'random-color-generator';
console.log(RandomRgbaColor()); // Outputs a random color in RGBA format
Import the 'RandomHslColor' function from 'random-color-generator':
import { RandomHslColor } from 'random-color-generator';
console.log(RandomHslColor()); // Outputs a random color in HSL format
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
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.
Respect our CODE OF CONDUCT
This project is licensed under the MIT License - see the LICENSE file for details.