@socketsecurity/lib
Version:
Core utilities and infrastructure for Socket.dev security tools
64 lines (63 loc) • 1.84 kB
JavaScript
;
/* Socket Lib - Built with esbuild */
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var ultra_exports = {};
__export(ultra_exports, {
RAINBOW_GRADIENT: () => RAINBOW_GRADIENT,
generateRainbowGradient: () => generateRainbowGradient
});
module.exports = __toCommonJS(ultra_exports);
const RAINBOW_GRADIENT = [
// Red/pink.
[255, 100, 120],
// Orange.
[255, 140, 80],
// Yellow/gold.
[255, 180, 60],
// Yellow/green.
[220, 200, 80],
// Green.
[120, 200, 100],
// Cyan/turquoise.
[80, 200, 180],
// Blue.
[80, 160, 220],
// Purple/violet.
[140, 120, 220],
// Pink/magenta.
[200, 100, 200],
// Red/pink.
[255, 100, 140]
];
function generateRainbowGradient(textLength) {
const colors = [];
for (let i = 0; i < textLength; i += 1) {
const colorIndex = i % RAINBOW_GRADIENT.length;
const color = RAINBOW_GRADIENT[colorIndex];
if (color) {
colors.push(color);
}
}
return colors;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
RAINBOW_GRADIENT,
generateRainbowGradient
});