@satyam-seth-learnings/gen-random-color
v1.0.7
Published
A lightweight JavaScript library for generating random colors in multiple formats (HEX, RGB, HSL).
Downloads
18
Maintainers
Readme
Random Color Generator
A lightweight JavaScript library for generating random colors in multiple formats (HEX, RGB, HSL).
Installation
npm install @satyam-seth-learnings/gen-random-color
Usages
const { randomHexColor, randomRgbColor, randomHslColor, generateColorPalette } = require('@satyam-seth-learnings/gen-random-color');
// Generate a random HEX color
console.log(randomHexColor()); // Example: #a3e4d7
// Generate a random RGB color
console.log(randomRgbColor()); // Example: rgb(123, 45, 67)
// Generate a random HSL color
console.log(randomHslColor()); // Example: hsl(210, 50%, 50%)
// Generate a palette of 5 random HEX colors
console.log(generateColorPalette('hex', 5)); // Example: ['#a3e4d7', '#ff5733', ...]