UNPKG

pigmentjs

Version:

A zero-dependency colour organisation, creation and manipulation library built for web developers.

21 lines 671 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.randomHex = void 0; var validations_1 = require("./validations"); var randomHex = function () { var r = Math.round(Math.random() * 255).toString(16); if (r.toString().length === 1) { r += r; } var g = Math.round(Math.random() * 255).toString(16); if (g.length === 1) { g += g; } var b = Math.round(Math.random() * 255).toString(16); if (b.length === 1) { b += b; } return (0, validations_1.validateHex)("#".concat(r).concat(g).concat(b).toUpperCase()); }; exports.randomHex = randomHex; //# sourceMappingURL=helpers.js.map