Package Exports
- rgb-random-color
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rgb-random-color) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rgb-random-color
Generates a single color randomly.
Installation
$ npm install rgb-random-color
Usage
'use strict';
const { randomColor } = require("rgb-random-color");
console.log(randomColor());
// #6cca5f
// When you need a different color to each element in an array
const markers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
markers.map(marker => {
console.log(randomColor());
})
/**
* Output :
#2634be
#6d8cf9
#146fb0
#cdcfd0
#c1474b
#dc5f1e
#dd0130
#6f470e
#96f011
#a6e0ec
*/
License
ISC