Skip to content

satyam-seth-learnings/npm_publish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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', ...]