1.1.0 • Published 1 year ago

get-random-color-by-kidker v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Get Random Color

npm version

Description

get-random-color-by-kidker is a simple package that provides utility functions to generate random colors in different formats, including:

  • RGB
  • RGBA
  • HSL
  • HSLA
  • Hexadecimal
  • CYMK
  • CYMKA

Installation

You can install this package via npm:

npm install get-random-color-npm-by-kidker

Examples

import * as getRandomColors from 'get-random-color-by-kidker';

// Generating a Random RGB Color: 

const randomRGB = getRandomColors.getRandomRGB();
console.log(randomRGB); // Example output: rgb(23, 145, 76)


// Generating a Random RGBA Color: 

const randomRGBA = getRandomColors.getRandomRGBA();
console.log(randomRGBA); // Example output: rgba(23, 145, 76, 0.8)

// Generating a Random Hexadecimal Color:

const randomHex = getRandomColors.getRandomHexadecimal();
console.log(randomHex); // Example output: #17e576


// Generating a Random HSL Color:

const randomHSL = getRandomColors.getRandomHSL();
console.log(randomHSL); // Example output: hsl(200%,50%,50%)


// Generating a Random HSLA Color:

const randomHSLA = getRandomColors.getRandomHSLA();
console.log(randomHSLA); // Example output: hsla(200%,50%,50%,0.7)

// Generating a Random CMYK Color:

const randomCMYK = getRandomColors.getRandomCMYK();
console.log(randomCMYK); // Example output: cmyk(20%, 50%, 30%, 10%)


// Generating a Random CMYKA Color:

const randomCMYKA = getRandomColors.getRandomCMYKA();
console.log(randomCMYKA); // Example output: cmyk(20%, 50%, 30%, 10%, 0.7)

Function OverView:

  • getRandomRGB(): Generates a random RGB color string in the format rgb(r, g, b).
  • getRandomRGBA(): Generates a random RGBA color string in the format rgba(r, g, b, a).
  • getRandomHexadecimal(): Generates a random Hexadecimal color string in the format #rrggbb.
  • getRandomHSL(): Generates a random HSL color string in the format hsl(h, s%, l%).
  • getRandomHSLA(): Generates a random HSLA color string in the format hsla(h, s%, l%, a).
  • getRandomCMYK(): Generates a random CMYK color string in the format cmyk(c%, m%, y%, k%).
  • getRandomCMYKA(): Generates a random CMYKA color string in the format cmyk(c%, m%, y%, k%, a).

Contributing:

Feel free to submit pull requests for improvements or open issues for any bugs you may encounter.

License:

This project is licensed under the MIT License.

Author:

Kidker95

1.1.0

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago