UNPKG

jsfakeit

Version:

![alt text](https://raw.githubusercontent.com/Anirban20001962/jsfakeit/main/logo.png)

29 lines (28 loc) 961 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.rgbColor = exports.hexColor = exports.color = exports.safeColor = void 0; const colors_1 = require("../data/colors"); const chooseRand_1 = require("../helper/chooseRand"); /** Generates safe color*/ const safeColor = () => { return (0, chooseRand_1.chooseRand)('safe', colors_1.colors); }; exports.safeColor = safeColor; /** Generates full color*/ const color = () => { return (0, chooseRand_1.chooseRand)('full', colors_1.colors); }; exports.color = color; /** Generates hexColor*/ const hexColor = () => { return '#' + Math.floor(Math.random() * 16777215).toString(16); }; exports.hexColor = hexColor; /** Generates rgbColor*/ const rgbColor = () => { const r = Math.floor(Math.random() * 255); const g = Math.floor(Math.random() * 255); const b = Math.floor(Math.random() * 255); return `rgb(${r},${g},${b})`; }; exports.rgbColor = rgbColor;